-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Wait indefintely for http connections on shutdown by default #106511
Wait indefintely for http connections on shutdown by default #106511
Conversation
This commit changes the meaning of the http shutdown timeout when set to 0. Previously the shutdown would proceed immediately, killing active http connections. With this change 0 means no timeout is used, but active connections are still waited on, indefinitely. This new behavior is what was originally intended for the default value of the shutdown timeout setting.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @rjernst, I've created a changelog YAML for you. |
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.
LGTM but I left a suggestion about logging during the infinite wait.
@@ -281,7 +281,8 @@ protected void doStop() { | |||
logger.warn(format("timed out while waiting [%d]ms for clients to close connections", shutdownGracePeriodMillis)); | |||
} | |||
} else { | |||
logger.debug("closing all client connections immediately"); | |||
logger.debug("waiting indefinitely for clients to close connections"); | |||
FutureUtils.get(allClientsClosedListener); |
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.
IMO it'd be slightly more operator-friendly to make this a loop of timed waits, logging and retrying on timeout, so that we can have some evidence in the logs that this is where we're waiting.
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 agree on Dave's point, when troubleshooting what's going here logs of periodic timeouts would help greatly
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 added logging. I put it at info level. There's a setting along with it, the poll time for how often we log, defaulting to 5 minutes.
@mosche @DaveCTurner Please have another look to see if the added logging is what you were thinking. |
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.
LGTM
logger.debug("waiting indefinitely for clients to close connections"); | ||
} | ||
|
||
// use a fixed time of 5 minutes for when to report how many connections remain |
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.
nit: no longer a fixed time
This commit changes the meaning of the http shutdown timeout when set to 0. Previously the shutdown would proceed immediately, killing active http connections. With this change 0 means no timeout is used, but active connections are still waited on, indefinitely. This new behavior is what was originally intended for the default value of the shutdown timeout setting.