Skip to content

Rust #325: worker history shows consumed signal sequences; full task snapshots - #710

Merged
rmcdaniel merged 4 commits into
mainfrom
rust-325-history-presentation
Oct 24, 2026
Merged

rmcdaniel merged 4 commits into
mainfrom
rust-325-history-presentation

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325.

Two differences found while comparing the message-stream fixture's worker polls with published Server 2.11.1:

  • Signal sequence in worker history. PHP's poll and history-page responses show a consumed signal's workflow_sequence on its SignalReceived (WorkflowTaskPoller::historyEventsWithSignalArgumentEnvelopes). Native now does the same, from the signal record, when the payload lacks one. The run's own history route still shows the event as recorded, as PHP's does.
  • Task snapshots. PHP's history task snapshots keep every field that is set (WorkflowHistoryEvent::taskSnapshot). Native now adds compatibility, last_dispatch_attempt_at, last_dispatched_at, last_dispatch_error, last_claim_failed_at and last_claim_error when present.

Checks

  • The new worker_history_presentation test passes on SQLite, PostgreSQL, MySQL and MariaDB.
  • The full SQLite suite with --all-targets passes, apart from that test's first draft (it forgot to register its worker; fixed).

Not changed here

Some events that PHP records with a task snapshot have none in native, such as ConditionWaitOpened and SignalWaitOpened; that audit is a follow-up.

Checkpoint: docs/rust-server-port-checkpoints/2026-10-23-worker-history-presentation.md.

…s, like Server 2.11.1

Worker polls and history pages add workflow_sequence to a consumed signal's
SignalReceived from its record, as WorkflowTaskPoller does; the run history
route still shows the event as recorded. Task snapshots keep compatibility,
the dispatch and claim stamps and errors when they are set, as
WorkflowHistoryEvent::taskSnapshot does.
Workflow 2.10.2's applySignal takes a workflow sequence only from the
signal's own wait, so a declared signal applied while a condition wait
is open keeps no sequence; only an undeclared signal takes the condition
wait's. Native recorded the condition wait's sequence for both, which
became visible once worker polls showed the record: the published-SDK
signal and query cohorts require worker history to equal the run's
history prefix (all nine SDK pairings on every database). A new test
covers the declared case and fails without the change.
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Rust Server: hosted run 40012133977 attempt 2 failed on all three databases with the same nine signal-namespace-sdk-* and nine query-sdk-* differences: worker history showed workflow_sequence where the run's history prefix did not. That was a real #710 regression, now fixed at 64f5ec436, which also integrates main 0667ba79f.

Cause. PHP's applySignal (Workflow 2.10.2) takes a sequence only from the signal's own wait. A signal the run's contract declares is applied without one even while a condition wait is open, and markConditionWaitSignalConsumed then finds it already applied. So its record keeps no sequence, and the worker-history enrichment adds nothing. Native recorded the condition wait's sequence for declared signals too. That was harmless until this PR made worker polls show the record.

Fix. Native now records a sequence only from the signal's own wait, or from a condition wait for an undeclared signal. The new test a_declared_signal_consumed_by_a_condition_wait_keeps_no_sequence fails without the change. The full SQLite execution suite passes: 451 passed, 1 ignored. #718, stacked on this branch, has the fix merged at 37cc7051c, and its suite also passes (452 passed, 1 ignored).

@rmcdaniel

Copy link
Copy Markdown
Member Author

Included in train #723, at exact head 069270b4e6a920720243ff7779c483d2f51a67ba on main 960aa3051. This PR's earlier hosted results are preserved above. Its remaining runs on the pre-#707 head are cancelled to free runners, and it closes as merged through #723.

@rmcdaniel
rmcdaniel merged commit 0a42962 into main Oct 24, 2026
26 of 27 checks passed
@rmcdaniel

Copy link
Copy Markdown
Member Author

Merged to main through train #729 (merge 6121960), which Security accepted at exact head 18c1b3a.

@rmcdaniel
rmcdaniel deleted the rust-325-history-presentation branch October 24, 2026 13:24
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