Skip to content

fix: prevent worker starvation after max_execution_time restarts#2207

Open
dunglas wants to merge 1 commit intomainfrom
fix/2205
Open

fix: prevent worker starvation after max_execution_time restarts#2207
dunglas wants to merge 1 commit intomainfrom
fix/2205

Conversation

@dunglas
Copy link
Member

@dunglas dunglas commented Feb 19, 2026

Fixes #2205. At least I hope so.

Disable the execution timer in frankenphp_worker_request_shutdown() to prevent stale timers from firing between requests. Also, fix evaluation order in frankenphp_handle_request() to check for shutdown before calling frankenphp_worker_request_startup().

Disable the execution timer in frankenphp_worker_request_shutdown() to
prevent stale timers from firing between requests. Also fix evaluation
order in frankenphp_handle_request() to check for shutdown before calling
frankenphp_worker_request_startup().

Fixes #2205

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlliBalliBaba
Copy link
Contributor

Not sure this will fix it. On fatal error frankenphp_request_shutdown() is never called and we long jump directly to after

php_execute_script(&file_handle);

@AlliBalliBaba
Copy link
Contributor

AlliBalliBaba commented Feb 19, 2026

I could imagine that php_request_startup() might fail for some reason, but not sure how to get it to fail. Basically some kind of startup error here (which is caught and not logged)
https://github.com/php/php-src/blob/c8912639008a89a195a258fc8cb924b5763c6766/main/main.c#L1950

Might be necessary to completely restart the thread if php_request_startup fails

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.

Permanent worker starvation after maximum execution time worker restarts

2 participants

Comments