Skip to content

fix(workflows): save overlapping join history in order - #24

Merged
eersnington merged 7 commits into
mainfrom
fix/workflows-join-history-order
Nov 8, 2026
Merged

eersnington merged 7 commits into
mainfrom
fix/workflows-join-history-order

Conversation

@eersnington

@eersnington eersnington commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Closes #20.

Overlapping ctx.join branches could save history that loadStorage cannot read, so replay failed with Name index N not found in registry. On actors, overlapping saves also failed with State cannot be mutated by another action while an experimental state-aware database transaction is active. Each failure counted as a step failure, so finished steps ran again and large joins ran out of retries.

  • flush() runs one save at a time per workflow, so an older snapshot cannot land after a newer one.
  • Saves that have not started share the next write. Saves with deletions keep their own write, so pruning stays in order.
  • A save marks only the names, entries and metadata it wrote as saved. Changes made during the write stay dirty.
  • A failed write or delete marks its data dirty again, so a later save retries it.
  • executeStep marks step metadata dirty when a step finishes or fails, so a sibling's earlier save cannot leave it as running.
  • Second commit, to squash: formats examples/docs/onboarding/index.ts so format:check passes, and removes the dangling docs/AGENTS.md symlink (its target was removed in baba281).
20-branch join on actors, rivetkit 3.0.4 main This PR
Finishes, no added latency not within 60 s 121 ms median
Finishes, 50 ms round trip not within 60 s 414 ms median
Steps run twice with no fault 66 of 190 0

Same fix in engine-ee: rivet-dev/engine-ee#1776.


This is part 1 of 5 in a stack:

@eersnington
eersnington merged commit d6d3ac1 into main Nov 8, 2026
2 checks passed
@eersnington
eersnington deleted the fix/workflows-join-history-order branch November 8, 2026 14:11
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.

Concurrent join branches can persist history with missing name-registry entries

1 participant