Repository navigation
Shared fixtures: wait for the embedded pending timer before cancelling it - #821
Conversation
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>
|
|
General's source review of exact 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. |
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>



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 recordedStartAccepted, WorkflowStarted, TerminateRequested, WorkflowTerminated, with noTimerScheduledorTimerCancelled. In embedded mode,cancellation-probe.phpran onequeue:work --onceand then cancelled or terminated thepending_timerrun. 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-timerandcancel-pending-timeron 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