Skip to content

Tell the requester when the handler failed every attempt - #10

Merged
v3dillon merged 1 commit into
mainfrom
claude/dispatcher-failure-notice
Oct 1, 2026
Merged

v3dillon merged 1 commit into
mainfrom
claude/dispatcher-failure-notice

Conversation

@v3dillon

@v3dillon v3dillon commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Problem

When a handler fails all four attempts, the dispatcher sets the job to failed and sends nothing. The requester waits for an answer that never comes. In production on 2026-09-30, Bauzentrale's handler failed four times with Request could not be recorded: storage., and the sender got no word.

Change

  • After the fourth failed try, the job goes to a new status notify, not failed.
  • A notify job sends one correlated finding to the requester: "This request was not handled. The handler failed 4 times, so the dispatcher stopped trying. Send the request again later." Then the job is failed.
  • The notice goes only to a sender that is still allowed and trusted, and only when no reply went out already (the same correlation check that execute uses). It mirrors the request's encryption through send.
  • A notice that cannot be sent is tried again with backoff, up to 4 more times. A notify job never runs the handler again, also after a crash.
  • trusted() is now one function, used by execute and by the notice.
  • README: the dispatcher section says what happens after the last try.

Tests

  • tests/runtime.rs: a request whose handler fails every attempt goes retrying ×3 → notify → failed. The requester gets exactly one finding in reply to the request, also when the notice step runs again. dispatcher status shows failed: 1. The test fails on main (("failed", 4) instead of ("notify", 4)).
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean. cargo test --test runtime passes.
  • On macOS, dispatcher::tests::configuration_is_validated_against_the_identity_and_filesystem fails on main and on this branch the same way. It is not related to this change.
  • End to end with Bauzentrale on a local relay: a handler with a wrong database failed 4 times, and the requester got the notice in reply to the request about 80 seconds after sending it.

🤖 Generated with Claude Code

A dispatcher whose handler failed four times marked the job failed and
sent nothing, so the requester waited in silence for an answer that
never came. After the last failed try the job now owes the requester a
notice: one correlated finding that says the request was not handled.
The notice is tried again with backoff, never runs the handler again,
and goes only to a sender that is still trusted and has no reply yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@v3dillon
v3dillon merged commit e1e51d5 into main Oct 1, 2026
2 checks passed
@v3dillon
v3dillon deleted the claude/dispatcher-failure-notice branch October 1, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant