Closed orien closed 6 years ago
We have a custom event source with a long polling interval (5 minutes). This plays havoc with the Event Sourcery graceful shutdown mechanism as it will take up to 5 minutes to stop.
We set @shutdown_requested upon receiving SIGTERM. But we only check @shutdown_request after waking from the poll wait sleep.
@shutdown_requested
SIGTERM
@shutdown_request
Instruct the main thread to wake upon receiving SIGTERM or SIGINT. So we don't wait the remainder of the poll wait sleep.
SIGINT
Context
We have a custom event source with a long polling interval (5 minutes). This plays havoc with the Event Sourcery graceful shutdown mechanism as it will take up to 5 minutes to stop.
We set
@shutdown_requested
upon receivingSIGTERM
. But we only check@shutdown_request
after waking from the poll wait sleep.Change
Instruct the main thread to wake upon receiving
SIGTERM
orSIGINT
. So we don't wait the remainder of the poll wait sleep.