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

feat(server): gracefully close websocket connections on server shutdown #143

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

laurentlp
Copy link
Contributor

This PR makes sure to properly close the websocket server and its connections upon server shutdown.

Closes MES-132

@linear
Copy link

linear bot commented Aug 20, 2021

Copy link
Contributor

@samuelmasse samuelmasse left a comment

Choose a reason for hiding this comment

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

I'm wondering if any of this is necessary. If we remove the http server from the Socket Server before calling close, then what does the close function do?

packages/server/src/launcher.ts Outdated Show resolved Hide resolved
packages/server/src/socket/manager.ts Outdated Show resolved Hide resolved
packages/server/src/socket/manager.ts Outdated Show resolved Hide resolved
packages/server/src/socket/service.ts Outdated Show resolved Hide resolved
packages/server/src/socket/manager.ts Outdated Show resolved Hide resolved
packages/server/src/socket/manager.ts Outdated Show resolved Hide resolved
@laurentlp
Copy link
Contributor Author

I'm wondering if any of this is necessary. If we remove the http server from the Socket Server before calling close, then what does the close function do?

I agree that it is kind of unnecessary, but still, it seems to be cleaner that way and doesn't add overhead. If you take a look at the definition of the server's close function, you can see that it does more than just closing the HTTP server.

Copy link
Contributor

@samuelmasse samuelmasse left a comment

Choose a reason for hiding this comment

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

👍

@laurentlp laurentlp merged commit 02b1619 into master Aug 23, 2021
@laurentlp laurentlp deleted the llp_websocket_graceful_shutdown branch August 23, 2021 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants