Skip to content

Shared fixtures: wait for the embedded pending timer before cancelling it - #821

Merged
rmcdaniel merged 1 commit into
mainfrom
rust-325-embedded-pending-timer-wait
Oct 27, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
rust-325-embedded-pending-timer-wait

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325. This fixes a reference-side race seen in #816's merge-group run 40561089085, MySQL existing-php corpus job.

The race. In terminate-pending-timer, the embedded reference recorded StartAccepted, WorkflowStarted, TerminateRequested, WorkflowTerminated, with no TimerScheduled or TimerCancelled. In embedded mode, cancellation-probe.php ran one queue:work --once and then cancelled or terminated the pending_timer run. When that single job returned before the workflow task was available, the command landed before the declared phase.

Fix. The embedded path now works single jobs until the run has recorded TimerScheduled. It is bounded at 15 seconds and fails clearly otherwise. The HTTP path already waits for the declared phase (line 70). No expectation changes.

Checked locally: five embedded recordings of terminate-pending-timer and cancel-pending-timer on SQLite against the 2.11.4 tuple pass. The race is rare, so this shows no regression rather than proving the race gone; the fix removes its mechanism. PHP lint is clean.

🤖 Generated with Claude Code

The embedded cancellation probe worked one queue job and then cancelled or
terminated a pending_timer run. When that one job returned before the
workflow task was available, the command landed before the timer was
scheduled, and the embedded 2.11.4 reference recorded no TimerScheduled or
TimerCancelled for terminate-pending-timer (#816's merge-group run
40561089085, MySQL existing-php corpus job 122392116528).

The embedded path now works single jobs until the run has recorded
TimerScheduled, for at most 15 seconds, and fails clearly otherwise, as the
HTTP path already waits for the declared phase. Five embedded recordings of
terminate-pending-timer and cancel-pending-timer on SQLite pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

General's source review of exact 0123716173e0f4df9dc0e59200ab313266ce985c found no blocker in the declared-phase correction. The embedded pending-timer path now observes TimerScheduled before invoking cancellation/termination, and refuses to record the requested phase if it is not reached. Frozen expected events and the HTTP path are unchanged.

I independently checked the exact diff and PHP8.3.36 syntax in an isolated container; lint passes. I did not repeat the owner's five embedded recordings, and this review is not a claim that the rare historical race was reproduced locally. The published-reference timer recordings reported in the PR and normal current-head/shared qualification retain their own scope. No source or fixture was edited by this review.

@rmcdaniel
rmcdaniel added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 27, 2026
rmcdaniel added a commit that referenced this pull request Oct 27, 2026
parallel_all's wait_for_timer gave a 3-second timer 3 seconds from the
call to fire. In #821's merge-group run 40579733447 the PostgreSQL
native-tests job (631 s for the suite) failed
nested_mixed_barrier_retains_all_paths_and_original_timer_after_cold_reopen
with "original all-group timer did not fire". The waits are positive: they
return as soon as TimerFired is recorded, so a longer bound only changes how
long a real failure takes to report. The three timer-fire waits in the file
now share a 15-second bound. parallel_all passes 11/11 on SQLite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel
rmcdaniel added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 2bbc965 Oct 27, 2026
57 checks passed
@rmcdaniel
rmcdaniel deleted the rust-325-embedded-pending-timer-wait branch October 27, 2026 23:47
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