mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-07-01 22:53:50 +03:00
`http.Server.Shutdown()` waits for in-flight requests but never cancels them, so long-lived ones (e.g. VictoriaLogs live tailing) make graceful shutdown timeout, and the resulting `logger.Fatalf` -> `os.Exit` skips the storage flush and loses data. So adding a cancelable `BaseContext` that is canceled once `-http.maxGracefulShutdownDuration` elapses. Updates https://github.com/VictoriaMetrics/VictoriaLogs/issues/1502 Also notes that VictoriaMetrics query execution is deadline-driven and ignores ctx, so it's a no-op there.