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.
2.2 KiB
2.2 KiB