Skip to content

fix: write terminal disposition before clearing DEFERRED (F14)#564

Merged
Muizzkolapo merged 1 commit into
integration/batch-online-unificationfrom
fix/f14-atomic-disposition
May 19, 2026
Merged

fix: write terminal disposition before clearing DEFERRED (F14)#564
Muizzkolapo merged 1 commit into
integration/batch-online-unificationfrom
fix/f14-atomic-disposition

Conversation

@Muizzkolapo
Copy link
Copy Markdown
Owner

Summary

  • Reorders write_record_dispositions() so the terminal disposition (FAILED, EXHAUSTED, FILTERED, etc.) is committed before clearing DEFERRED
  • Previously, clear_disposition(DEFERRED) was called first — a crash between clear and write left the record with no disposition at all (invisible)
  • The UNIQUE constraint on (action_name, record_id, disposition) allows both rows to coexist since disposition values differ

Verification

  • 6 new regression tests verify ordering invariant and crash-safety
  • TDD red→green: tests failed on the old code, pass on the fix
  • 6850 passed, ruff clean (2 pre-existing failures on main unrelated to this change)

write_record_dispositions() previously called clear_disposition(DEFERRED)
before set_disposition(terminal). A crash between the two left the record
with no disposition — invisible to queries.

Reorder: write the terminal disposition first, then clear DEFERRED. The
UNIQUE(action_name, record_id, disposition) constraint allows both rows
to coexist since disposition values differ. If the process crashes after
the terminal write but before the DEFERRED clear, the terminal state is
already committed and queryable.

6 regression tests verify the ordering invariant and crash-safety.
@Muizzkolapo Muizzkolapo force-pushed the fix/f14-atomic-disposition branch from 98007fa to d16803c Compare May 19, 2026 16:52
@Muizzkolapo Muizzkolapo changed the base branch from main to integration/batch-online-unification May 19, 2026 16:52
@Muizzkolapo Muizzkolapo merged commit f3856af into integration/batch-online-unification May 19, 2026
4 of 5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant