Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplexed websocket instances should remove handlers when finished #3064

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

niloc132
Copy link
Member

@niloc132 niloc132 commented Nov 4, 2022

Also includes a workaround for a NodeJS WebSocket polyfill, which doesn't use the expected CloseEvent/MessageEvent constructors.

Fixes #3063

Also includes a workaround for a NodeJS WebSocket polyfill, which
doesn't use the expected CloseEvent/MessageEvent constructors.

Fixes deephaven#3063
Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Structurally, looks OK. I don't really know how the JS layers work. Assuming this covers all the webSocket.addEventListener cases, and we think it covers all the cases we need for removeHandlers(), LGTM.

Copy link
Contributor

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears to be working. In the browser I set a breakpoint where the websocket is created in dh-core and stored as a global variable. Then calling getEventListeners(temp1) you can see the listeners attached. Started at 6. Opening a table went to 8. Closing the panel went to 7. Re-opening went back to 8. Closing again back to 7.

In Node for the snapshot tool, the number of handlers slowly creeps up, but I may be flooding the server or the cleanup is being delayed. Or I have a case I'm not handling in the overload I have to do to patch the Node ws to more closely match the browser. I'm seeing about 75% on a given event are closed, but possible it's entirely my fault

@niloc132 niloc132 merged commit ea7854b into deephaven:main Nov 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS gRPC MultiplexedWebsocketTransport doesn't correctly remove websocket event listeners
3 participants