Skip to content

Fix PHP 8.4 task exit handling#377

Merged
realFlowControl merged 1 commit into
developfrom
codex/fix-php84-exit-runtime
May 27, 2026
Merged

Fix PHP 8.4 task exit handling#377
realFlowControl merged 1 commit into
developfrom
codex/fix-php84-exit-runtime

Conversation

@realFlowControl
Copy link
Copy Markdown
Collaborator

@realFlowControl realFlowControl commented May 27, 2026

Fixes a PHP 8.4 regression where a task that calls exit after worker-side includes could prevent a parallel\Runtime from continuing to drain queued tasks.

On PHP 8.4 and newer, exit/die reaches the task scheduler as PHP’s internal UnwindExit/GracefulExit exception. The scheduler was treating that object as a normal task exception and passing it to php_parallel_exceptions_save(), which expects normal Error/Throwable properties. This shuts down the runtime and as such will not execute scheduled tasks.

This change detects the internal exit objects before the normal exception-copy path, clears them, marks only the current future as killed, and lets the worker continue processing queued work.

Fixes #375

@realFlowControl realFlowControl changed the title [codex] Fix PHP 8.4 task exit handling Fix PHP 8.4 task exit handling May 27, 2026
@realFlowControl realFlowControl force-pushed the codex/fix-php84-exit-runtime branch from a79c467 to b952fb1 Compare May 27, 2026 07:05
@realFlowControl realFlowControl marked this pull request as ready for review May 27, 2026 07:08
@realFlowControl realFlowControl added this to the v1.2.14 milestone May 27, 2026
@realFlowControl realFlowControl merged commit 476ba05 into develop May 27, 2026
87 of 88 checks passed
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.

[Bug] Runtime does not run the function under very strange conditions

1 participant