Skip to content

Commit 2a1a171

Browse files
authored
fix(install): Increase stop timeout to 60 seconds (#731)
This is to ensure clean shutdown of Celery, with fully drained queues. This is needed as versions may change the event format and not be backwards compatible. FWIW this is a hacky workaround without a strong guarantee that the queues will be empty. Ideally we'd shutdown everything first, spin up the workers and check for queues being drained every second or so.
1 parent e9cff2e commit 2a1a171

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

install.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ MIN_DOCKER_VERSION='19.03.6'
1515
MIN_COMPOSE_VERSION='1.24.1'
1616
MIN_RAM=2400 # MB
1717

18+
# Increase the default 10 second SIGTERM timeout
19+
# to ensure celery queues are properly drained
20+
# between upgrades as task signatures may change across
21+
# versions
22+
STOP_TIMEOUT=60 # seconds
1823
SENTRY_CONFIG_PY='sentry/sentry.conf.py'
1924
SENTRY_CONFIG_YML='sentry/config.yml'
2025
SYMBOLICATOR_CONFIG_YML='symbolicator/config.yml'
@@ -76,7 +81,7 @@ cleanup () {
7681
fi
7782

7883
if [[ -z "$MINIMIZE_DOWNTIME" ]]; then
79-
$dc stop &> /dev/null
84+
$dc stop -t $STOP_TIMEOUT &> /dev/null
8085
fi
8186
}
8287
trap_with_arg cleanup ERR INT TERM EXIT
@@ -224,9 +229,9 @@ if [[ -n "$MINIMIZE_DOWNTIME" ]]; then
224229
else
225230
# Clean up old stuff and ensure nothing is working while we install/update
226231
# This is for older versions of on-premise:
227-
$dc -p onpremise down --rmi local --remove-orphans
232+
$dc -p onpremise down -t $STOP_TIMEOUT --rmi local --remove-orphans
228233
# This is for newer versions
229-
$dc down --rmi local --remove-orphans
234+
$dc down -t $STOP_TIMEOUT --rmi local --remove-orphans
230235
fi
231236

232237
ZOOKEEPER_SNAPSHOT_FOLDER_EXISTS=$($dcr zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/data/version-2 | wc -l | tr -d '[:space:]'')

0 commit comments

Comments
 (0)