-
Notifications
You must be signed in to change notification settings - Fork 607
Wait for zero in-flight requests before terminating realtime proxy #2402
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
Conversation
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 think we can achieve the same without adding an endpoint. You can simply wait for in-flight requests when the proxy gets the SIGTERM
signal and before calling server.Shutdown()
Ref to the code: Lines 172 to 189 in 16ffd08
|
@miguelvr yeah, that would be cleaner! I just tried adding it there, but it didn't work as we expected. So I dug into it, and realized that we weren't handling the TERM signal (just INT). After listening for TERM too, checking the breaker's in-flight count was no longer necessary, since What are your thoughts on the diff now? |
Thanks for the PR! I built the images and tried my test (route which sleeps 1 sec). Contrary to the previous verion, deleting a pod did not result in 503s. Good job! |
@tfriedel awesome, thanks for bringing this to our attention, and for confirming that the fix is working as intended! I'm working on a separate PR now to support custom preStop commands. |
No description provided.