Repository navigation
fix(pegboard-envoy): retry failed actor event dispatch instead of dropping events - #5859
eersnington wants to merge 1 commit into
Conversation
|
This PR was not deployed automatically as @eersnington does not have access to the Railway project. In order to get automatic PR deploys, please add @eersnington to your workspace on Railway. |
Review: retry failed actor event dispatchThe approach is sound. Retrying the same batch in order fixes the dropped "stopped" bug, and Potential issues
Tests
Nits
No security concerns. Overall this looks good, and (1) is the one I would address before merging. |
934064c to
ee7dc70
Compare
ee7dc70 to
b76a582
Compare
ReviewThe fix is correct and small. Retrying the same batch in order stops one transient UDB error from wedging an actor's event stream, and cancelling the token after the senders drop keeps buffered events draining. 1. Eviction can race with a retrying handler. The idle sweep drops the sender but not the task. A handler stuck retrying through an outage longer than 2. Unbounded retry on non-transient errors. 3. Minor
4. Test. Good end-to-end repro with real Postgres and Toxiproxy. Not covered: the eviction case in point 1, and the shutdown-while-retrying path. Overall this looks good. Point 1 is the one I would most like addressed or acknowledged. |
Retry a failed actor event dispatch instead of dropping every later event for that actor.
actor_event_demuxer.rs, onedispatch_eventserror (for example UDB "max number of transaction retries reached") ended the handler loop. The actor never got its "stopped" event, so every later wake waited forever.Backoff::new(5, None, 250, 250)until it lands. This is safe because the actor2 workflow ignores events it already received (dedupe on generation and index).shutdown()cancels the token after it drops the senders. Handlers still dispatch buffered events, and a handler that is retrying exits.dispatch_eventstakes&[EventWrapper]so the batch can be retried.