Skip to content

Outbox direct dispatch records a failed batch send against every row in the batch #647

Closed

Description

@thomhurst

Summary

When a native batch send fails, the direct dispatcher records a failed attempt on every row in that batch. One message that the broker rejects (for example one that is too large) therefore burns attempts on all its neighbours, and recovery regroups the same rows on the next pass. Design §6.1 states that "a poison outbox row never blocks unrelated messages."

Evidence

  • src/Relayer.Outbox.PostgreSql/PostgreSqlDirectDispatcher.cs:238-246: on exception, for (i < live) RecordDispatchFailureAsync(_claims[i], error.Message, ...).
  • src/Relayer.Outbox.SqlServer/SqlServerDirectDispatcher.cs:202-210: the same loop.

Whether each transport's batch send can report per-message failures was not checked.

Proposal

On a batch failure, retry the rows individually (or use the transport's per-message batch result where it has one) before recording an attempt, so only the failing row is counted.

Found by reading the code at 02fe06f; not reproduced at runtime unless stated.

Triage audit

Checked origin/main 3dea7d414b38e2e505b67a6d8aa9104dc1d57538; the reported behavior remains.

Remaining scope and acceptance criteria

Activity

  1. added
    bug
    area: outbox
    P2
    on Nov 13, 2026
  2. thomhurst commented on Nov 13, 2026

    @thomhurst
    OwnerAuthor

    Audited current main and linked work; added actionable acceptance criteria and clarified the remaining scope in the issue body.

  3. added
    in-progress
    on Nov 13, 2026
  4. self-assigned this
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2area: outboxbugin-progress

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions