Reduce CLI callback shutdown timeout (5s -> 500ms).
I found that there are some situations with `response_mode=form_post` where Chrome will open additional speculative TCP connections. These connections will be idle so they block server shutdown until the (previously 5s) timeout. Lowering this to 500ms should be safe and makes any added latency at login much less noticeable. More information about Chrome's TCP-level behavior here: https://bugs.chromium.org/p/chromium/issues/detail?id=116982#c5 Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
parent
405a27ba90
commit
b6580b303a
@ -850,9 +850,9 @@ func (h *handlerState) serve(listener net.Listener) func() {
|
|||||||
}
|
}
|
||||||
go func() { _ = srv.Serve(listener) }()
|
go func() { _ = srv.Serve(listener) }()
|
||||||
return func() {
|
return func() {
|
||||||
// Gracefully shut down the server, allowing up to 5 seconds for
|
// Gracefully shut down the server, allowing up to 5 00ms for
|
||||||
// clients to receive any in-flight responses.
|
// clients to receive any in-flight responses.
|
||||||
shutdownCtx, cancel := context.WithTimeout(h.ctx, 5*time.Second)
|
shutdownCtx, cancel := context.WithTimeout(h.ctx, 500*time.Millisecond)
|
||||||
_ = srv.Shutdown(shutdownCtx)
|
_ = srv.Shutdown(shutdownCtx)
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user