Files
ubicloud/scheduling/dispatcher.rb
Benjamin Satzger 761f89565e Graceful shutdown of respirate process
When the Heroku dyno manager restarts a dyno, it sends SIGTERM. It then
waits for graceful shutdown for 30 seconds before it sends SIGKILL.

We now trap SIGTERM in the dispatcher to trigger graceful shutdown,
during which:
- no new strands are started
- running strands are allowed to finish
- if no more running strands -> exit the process

Without this graceful shutdown, strands running when SIGTERM is
received aren't given an opportunity to release their lease. These
strands are then locked for up to two minutes, until the lease expires.
2024-04-12 11:46:26 +02:00

2.2 KiB