-
Notifications
You must be signed in to change notification settings - Fork 149
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
ConsoleHost shutdown timeout too short #61
Comments
Functionality added by https://github.com/PeterKottas/DotNetCore.WindowsService/releases/tag/v2.0.5. Timeout is now configurable. Thanks for raising this |
Peter maybe I'm being dense, I don't see changes in 2.0.5 that address this issue. |
Maybe we're talking about different timeouts then. I've modified the one that waits for change in service state and made it configurable. Is it not the one you were talking about? |
In ConsoleServiceHost.cs, the method HandleCancelKeyPress only waits 150ms for the application to terminate after sending the stop signal. I don't have a way to get my application to respond to the event that quickly when running locally. This timeout is much shorter than the same timeout in the real service host. |
Ah sure, the topshelf ripoff :) Ok I should be able to get that there over the weekend. |
There is still a timeout of 150ms in ConsoleServiceHost / HandleCancelKeyPress at line 112. |
Yeah definitely. Feel free to create a PR to do this. I might end up doing it myself but it will take a few weeks at least. |
When running as a console application, shutdown is only given 150ms to complete. I have a very simple application and all I'm doing in shutdown is starting an async stop of an aspnet core application and it takes about 170ms to complete.
The ServiceHost gives a 1000ms timeout here in this case. I would recommend minimally making the timeouts match in the ConsoleHost. Ideally, all of these timeouts would be configurable. I believe the win32 service api allows an application to request additional startup/shutdown time if these timeouts were to be made significantly larger.
The text was updated successfully, but these errors were encountered: