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
Close open WebSocket sessions when application is shutting down #4775
Close open WebSocket sessions when application is shutting down #4775
Conversation
…to feature/websocksession-applicationshuttingdown
Will have a look at this tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! :) 👏
This looks good to me, @michaelstaib you have the subscriptions currenlty on the brain stack, any objections for this?
src/HotChocolate/AspNetCore/src/AspNetCore/WebSocketSubscriptionMiddleware.cs
Outdated
Show resolved
Hide resolved
src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/WebSocketSession.cs
Outdated
Show resolved
Hide resolved
…onMiddleware.cs Co-authored-by: PascalSenn <senn.pasc@gmail.com>
…s://github.com/oising/hotchocolate into feature/websocksession-applicationshuttingdown
Related #4813 |
12.7.1? update: never mind, I see you've moved it to v13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have integrated it into the new subscription layer.
/AzurePipelines run |
Azure Pipelines successfully started running 3 pipeline(s). |
Kudos, SonarCloud Quality Gate passed! |
…n is shutting down" (#5166)
When a dotnet core process hosting hotchocolate is signaled to shutdown, any open websocket sessions (i.e. subscriptions) will cause the shutdown process to stall until the default timeout, which is 30 seconds. At this point, the process is forcefully terminated. While the default is 30 seconds, some people (namely me, lol) have longer timeouts due to other things going on in their server. This makes my k8s rolling upgrades take a lot longer than I'd like :)
I noticed that WebSocket sessions are not explicitly closed on application shutdown. This PR adds that functionality.