mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Make shutdown timeout configurable (#1806)
Currently, when shutting down the server (via SIGINT or SIGTERM), the shutdown closes any open connections after only 10 seconds (via a context.WithTimeout). This does not provie a lot of time for longer operations, such as listing versions, or downloading a larger module zip file. When running in Kubernetes, and scaling instances or changing config, this causes a lot of dropped connections and gateway errors. 10 seconds is arguably much too short, and should be configurable. This commit increases that default to 60 seconds, and adds a config variable to allow users to specify their desired timeout.
This commit is contained in:
@@ -305,6 +305,12 @@ SingleFlightType = "memory"
|
||||
# Env override: ATHENS_INDEX_TYPE
|
||||
IndexType = "none"
|
||||
|
||||
# ShutdownTimeout sets the timeout (in seconds) for open connections when shutting down
|
||||
# (via SIGINT or SIGTERM). Connections still open after the timeout will be dropped.
|
||||
# Defaults to 60
|
||||
# Env override: ATHENS_SHUTDOWN_TIMEOUT
|
||||
ShutdownTimeout = 60
|
||||
|
||||
[SingleFlight]
|
||||
[SingleFlight.Etcd]
|
||||
# Endpoints are comma separated URLs that determine all distributed etcd servers.
|
||||
|
||||
Reference in New Issue
Block a user