Skip to content

BLOCK_ON_ERROR: the router ACKs untried siblings and the platform owns the re-queue

Accepted. Refined on 2026-11-09 so that the group is per subscription.

Approx. 2026-09 (owner ruling A-01); per-subscription groups 2026-11-09.

Ordered delivery has three modes: IMMEDIATE, NEXT_ON_ERROR and BLOCK_ON_ERROR. They differ in one respect, which is what a terminal failure does to the rest of the group. BLOCK_ON_ERROR exists for work where later messages are meaningless without the earlier one, such as “add item” after an order that was never created.

Originally a terminally failed head Nacked its buffered successors back to the broker. That looks like the safe choice, and it is the opposite. The successors redeliver on the broker’s own timer, which has nothing to do with the failure being resolved. The head has been dealt with, so the first successor becomes the new head and is delivered.

  • When an ordered head fails terminally, the router ACKs the untried successors off the queue instead of releasing them.
  • Nothing is lost by acknowledging: the dispatch-job rows remain in the platform database, which is the system of record. The queue copy is a delivery attempt.
  • The platform owns recovery. Held jobs are put back to PENDING by the settled-message hook (POST /api/dispatch/settled, called from the router when FC_ROUTER_PLATFORM_URL is set) and, as a backstop, by the reaper. The failed head is marked FAILED for review.
  • Enforcement for platform dispatch jobs sits in the platform at two points. At claim time, a BLOCK_ON_ERROR job is held back while an earlier job in its group is holding the group up. At delivery time, a job held by an earlier sibling is acknowledged and reset to PENDING without consuming retry budget.
  • “Holding” means FAILED/ERROR, or PENDING with a future scheduled_for (a job sitting out a retry backoff). QUEUED and PROCESSING do not hold, otherwise every ordered group would run one job per poll. The comparison is positional over (sequence, created_at, id), not set membership.
  • Operators resolve a blocked group by retrying, cancelling (FAILED to CANCELLED) or completing (FAILED to COMPLETED) the head.
  • Since 2026-11-09 the group key stored on a job is <subscription id>:<event message group> (hashed when too long). One subscriber’s failure holds only its own later jobs and blocks them until resolved, while other subscribers of the same event group keep flowing. Previously the group was shared across subscriptions, and a stalled job of an earlier-sequenced subscription held every later one.

Good:

  • The mode name now means what it says. Successors cannot overtake a failed head.
  • The queue stays small: held work is not circulating through the broker.
  • Failure isolation per subscriber.

Bad:

  • Recovery depends on the platform. If the settled hook is not configured, the reaper’s interval is the recovery latency.
  • Jobs raised before the per-subscription change keep the bare group key (an optional ops script re-keys pending and failed ones).
  • Blocked groups need a human decision. That is intended, but unattended groups pile up.
Alternative Why not
Release successors to the broker Redeliver on the broker timer, delivered ahead of the failed head.
Skip the failed message and continue That is NEXT_ON_ERROR.
Hold the successors in router memory Lost on restart; not visible to operators.