A failing event's retry sleeps inside the handler and holds up every later event of that handler (head-of-line stall, ~3 s per event) #2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (bug): one failing event never holds up the events after it for the same handler, so a projection keeps up in production while a single write retries.
Class.
evoq_event_handlerruns a retry inside the handler process:execute_error_action({retry, DelayMs}, …)callstimer:sleep(DelayMs)and then handles the same event again (evoq_event_handler.erl:350in 1.30.8). The default policy (evoq_error_handler) is 5 tries,exponential_jitterfrom 100 ms, so one failing event takes about 3 s or more before it is dead-lettered. The router's courier for that handler calls it withgen_server:call(…, infinity). Every later event for that handler waits in the courier's mailbox for the whole retry run. Other handlers are not held up (one courier each, since the courier change), but that projection's read model stalls: about 3 s per failing event, more when several fail in a row.Instance. macula-io/macula-realm#26 (repro: issues/26#issuecomment-4692).
ProjectRealm.RealmMemberAdmittedV1ToRealmMembersreturns{error, _}on a foreign-key miss, which engages the default retry.Not proposed here: the shape of the fix. One option is a retry that does not block later events, a
send_afterto the handler itself, but that changes the per-handler order a projection may rely on. Another is a per-handler cap on the stall. The owner of evoq decides.