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

Make graceful shutdown work at request rather than connection granularity #1365

Closed
sfackler opened this issue Oct 31, 2017 · 1 comment
Closed
Labels
A-server Area: server. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.

Comments

@sfackler
Copy link
Contributor

The graceful shutdown logic currently waits until all Services have dropped (i.e. all connections have closed). However, with keep-alive this is overconservative - what we'd really like is to wait until pending requests have finished.

This can't be correctly modeled with the current API, however. The last point in a request/response pair that user code is aware of is when it sends the last bit of the response body through the body channel. It will still take some amount of time for that bit to be written out over the network, so we can't immediately shut down after that's done.

@sfackler
Copy link
Contributor Author

sfackler commented Nov 1, 2017

@seanmonstar pointed out that a simple way of doing this is to add a method to disable keep-alive on Connections. Then, Service::drop-based tracking will be accurate.

@seanmonstar seanmonstar added A-server Area: server. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. C-feature Category: feature. This is adding a new feature. labels Nov 10, 2017
sfackler added a commit to sfackler/hyper that referenced this issue Nov 29, 2017
sfackler added a commit to sfackler/hyper that referenced this issue Nov 29, 2017
sfackler added a commit to sfackler/hyper that referenced this issue Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-server Area: server. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.
Projects
None yet
Development

No branches or pull requests

2 participants