mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:13:45 -05:00
[misc] let proxys observe an upcoming shutdown before starting to drain
Otherwise clients may be routed to the same pod upon reconnecting.
This commit is contained in:
parent
2b1c5bf436
commit
d320c2d5f3
2 changed files with 10 additions and 3 deletions
|
@ -125,9 +125,14 @@ drainAndShutdown = (signal) ->
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
Settings.shutDownInProgress = true
|
Settings.shutDownInProgress = true
|
||||||
|
statusCheckInterval = Settings.statusCheckInterval
|
||||||
|
if statusCheckInterval
|
||||||
|
logger.warn signal: signal, "received interrupt, delay drain by #{statusCheckInterval}ms"
|
||||||
|
setTimeout () ->
|
||||||
logger.warn signal: signal, "received interrupt, starting drain over #{shutdownDrainTimeWindow} mins"
|
logger.warn signal: signal, "received interrupt, starting drain over #{shutdownDrainTimeWindow} mins"
|
||||||
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
|
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
|
||||||
shutdownCleanly(signal)
|
shutdownCleanly(signal)
|
||||||
|
, statusCheckInterval
|
||||||
|
|
||||||
|
|
||||||
Settings.shutDownInProgress = false
|
Settings.shutDownInProgress = false
|
||||||
|
|
|
@ -60,6 +60,8 @@ settings =
|
||||||
|
|
||||||
publishOnIndividualChannels: process.env['PUBLISH_ON_INDIVIDUAL_CHANNELS'] or false
|
publishOnIndividualChannels: process.env['PUBLISH_ON_INDIVIDUAL_CHANNELS'] or false
|
||||||
|
|
||||||
|
statusCheckInterval: parseInt(process.env['STATUS_CHECK_INTERVAL'] or '0')
|
||||||
|
|
||||||
sentry:
|
sentry:
|
||||||
dsn: process.env.SENTRY_DSN
|
dsn: process.env.SENTRY_DSN
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue