Server shutdown prevents large response from being sent to client during draining
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
Starting application host shutdown causes a large pending response to not be gracefully sent during shutdown.
- Start HTTP/2 request. Request pauses for 5 seconds on server.
- Start server application host shutdown during pause.
- HTTP/2 request resumes, writes 2mb to response, and finishes.
- Client only receives part of the response, e.g. 180kb. Hangs while waiting for the rest.
- Server application eventually hits shutdown timeout and forcefully closes connection.
- Client gets IOException.
Expected Behavior
I expect the client to get the entire response.
If the client app doesn’t start application host shutdown then the client correctly gets the entire response.
Steps To Reproduce
Ignore gRPC in the repo and project titles. gRPC user originally reported this but I reduce the repo to basic HTTP.
https://github.com/JamesNK/GrpcShutdownTest
- Run server.
- Run client.
(optional: comment out await StartShutdownCall(logger, client);
in client to see the request succeed when no shutdown is triggered)
Exceptions (if any)
No response
.NET Version
6.0.300-preview.22154.4
Anything else?
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Server shutdown prevents large response from being sent ...
Starting application host shutdown causes a large pending response to not be gracefully sent during shutdown. Start HTTP/2 request. Request ...
Read more >Graceful HTTP Connection Draining During Shutdown?
This means that connections terminate cleanly, without a TCP close unless a timeout is exceeded.
Read more >Draining — envoy 1.28.0-dev-1c259b documentation
For instance, during server shutdown, existing requests can be discouraged and listeners set to stop accepting, to reduce the number of open connections...
Read more >Node Shutdown
There are two ways to handle node shutdown: To temporarily stop a node and restart it later, drain the node and terminate the...
Read more >The system has rebooted without cleanly shutting down first
When using shutdown.exe to restart a server, the shutdown process will normally allow 30 seconds to ensure each running service has time to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed this is a Kestrel bug.
May have spoken too soon. The browser has the same problem but it downloads up to 6mb of the response. A response bigger than 6mb has the same issue.
I’ll keep investigating.