Skip to content

Wait for connections to drain. #110

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

Merged
merged 1 commit into from
Feb 25, 2020
Merged

Wait for connections to drain. #110

merged 1 commit into from
Feb 25, 2020

Conversation

mheffner
Copy link
Contributor

tl;dr: Allow active connections/requests to drain gracefully during shutdown.

When calling Server.Shutdown() the listening Go routine will return immediately and no new connections will be accepted. However, Shutdown will block until all active connections are finished or the context times out. Therefore, we must wait until Shutdown returns before we continue shutting down the API and eventually exiting the process.

Copy link
Member

@rybit rybit left a comment

Choose a reason for hiding this comment

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

good catch

@mheffner mheffner merged commit 2a079b7 into master Feb 25, 2020
@mheffner mheffner deleted the fix/connection-draining branch February 25, 2020 15:41
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.

2 participants