-
Notifications
You must be signed in to change notification settings - Fork 469
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
Graceful shutdown #108
Graceful shutdown #108
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have this function receive a context, and to have the WriteControl respect that ( somehow ).
We don't want to have a "stuck" endpoint to hang our shutdown process.
sorry - I know it's not easy to implement ;-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has a deadline (now + 5 seconds). How this is called in wsNetwork.go will start a thread per peer, so they'll all wait those 5 seconds in parallel and so at most 5 seconds after WebsocketNetwork.Close() is called it should be done.
I agree in principle, it would be neat to upgrade all of websocket to Write and Read with context. Can we punt for a separate soonish TODO issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course. This change is a great improvement on its own and shouldn't be deferred.
We can make it even better tomorrow ;-)