Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Graceful shutdown and draining of requests #1026

Closed
synhaptein opened this issue Aug 3, 2016 · 2 comments
Closed

Graceful shutdown and draining of requests #1026

synhaptein opened this issue Aug 3, 2016 · 2 comments

Comments

@synhaptein
Copy link

I don't know if it's fixed yet, because I can not test the current version, but when I'm calling (IApplicationLifetime)lifetime.StopApplication(), every in flight requests are just killed instead of giving them time to finish and send their response back. Is it fixed, by design or a bug?

@halter73
Copy link
Member

The application should have 5 seconds by default to finish processing any ongoing requests. This timeout is configurable via KestrelServerOptions.ShutdownTimeout which can be modified in the options callback in WebHostBuilder.UseKestrel. After the timeout, the underlying socket will be unceremoniously closed and Kestrel's shutdown sequence will complete.

@synhaptein Can you explain how the in-flight requests are being killed? Are there any APIs that are throwing? Does the thread just get aborted as the process exits? Verbose logging might be helpful. If you are using ctrl-c to stop the application you might be running into https://github.com/dotnet/cli/issues/812.

@muratg
Copy link
Contributor

muratg commented Aug 17, 2016

This should be fixed in 1.0.0. Please give it a try when you can, and if you still have issues, please file another bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants