arroyo icon indicating copy to clipboard operation
arroyo copied to clipboard

feat: A better API for abandoning messages on shutdown

Open lynnagara opened this issue 1 year ago • 1 comments

There were a number of incidents recently (e.g. inc-706) where consumers were not shutdown cleanly as they were unable to finish processing all pending messages before they get kicked out by the broker or kubernetes due to timeouts.

In order to facilitate quicker shutdown, this change aims to make it easier for consumers to drop work and shutdown faster instead of attempting to finish processing every message that has been queued.

A number of strategies that support asynchronous processing (run task in threads, run task with multiprocessing, reduce, unfold, batch, unbatch) now support an optional abandon_messages_on_shutdown argument in the constructor. If this is set to true, any work in this processing strategy will be immediately dropped on shutdown. The default is false for backward compatibility.

lynnagara avatar Apr 13 '24 00:04 lynnagara

FYI something similar to this was implemented in https://github.com/getsentry/snuba/pull/5918

untitaker avatar May 17 '24 13:05 untitaker