Restore proper non-graceful shutdown behavior#866
Conversation
Commits cc87190 and e9575bf attempted to retain the old non-graceful shutdown behavior if the graceful shutdown timeout was zero/not specified by converting the deferred close calls into an if block after the server received its shutdown signal. However, the commits didn't account for the fact that those deferred calls were executed in reverse order, having the opposite effect: the frontend server waited indefinitely for all frontend connections to close. Reorder the close calls so that they are called in the same order as when they were called via the defer statements. Also, pass the Run method's context to the call to frontendShutdown, as this is the same context that was passed to the wrapped HTTP server's Shutdown method previously. Fixes: cc87190 ("addressing review") Fixes: e9575bf ("shut down leaseController gracefully") Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
|
Welcome @twz123! |
|
Hi @twz123. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: twz123 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@ipochi Can you look at this? |
|
/ok-to-test |
PR #794 attempted to retain the old non-graceful shutdown behavior if the graceful shutdown timeout was zero/not specified by converting the deferred close calls into an if block after the server received its shutdown signal. However, the PR didn't account for the fact that those deferred calls were executed in reverse order, having the opposite effect: the frontend server waited indefinitely for all frontend connections to close.
Reorder the close calls so that they are called in the same order as when they were called via the defer statements. Also, pass the
Runmethod's context to the call tofrontendShutdown, as this is the same context that was passed to the wrapped HTTP server's Shutdown method previously.Fixes: