[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:
Jakob Ackermann 2020-02-20 21:44:21 +01:00
parent 2b1c5bf436
commit d320c2d5f3
2 changed files with 10 additions and 3 deletions

View file

@ -125,9 +125,14 @@ drainAndShutdown = (signal) ->
return
else
Settings.shutDownInProgress = true
logger.warn signal: signal, "received interrupt, starting drain over #{shutdownDrainTimeWindow} mins"
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
shutdownCleanly(signal)
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"
DrainManager.startDrainTimeWindow(io, shutdownDrainTimeWindow)
shutdownCleanly(signal)
, statusCheckInterval
Settings.shutDownInProgress = false

View file

@ -60,6 +60,8 @@ settings =
publishOnIndividualChannels: process.env['PUBLISH_ON_INDIVIDUAL_CHANNELS'] or false
statusCheckInterval: parseInt(process.env['STATUS_CHECK_INTERVAL'] or '0')
sentry:
dsn: process.env.SENTRY_DSN