Skip to content

fix: don't hang requests dispatched before regular threads are ready - #2612

Merged
henderkes merged 1 commit into
php:mainfrom
ptondereau:fix/early-request-nil-regular-request-chan
Aug 20, 2026
Merged

fix: don't hang requests dispatched before regular threads are ready#2612
henderkes merged 1 commit into
php:mainfrom
ptondereau:fix/early-request-nil-regular-request-chan

Conversation

@ptondereau

@ptondereau ptondereau commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Caddy sometimes starts the HTTP server before FrankenPHP finishes initializing.
A request arriving in that window passes the isRunning check, but regularRequestChan is still nil, so it blocks forever in handleRequestWithRegularPHPThreads().
Behind a reverse proxy, this shows up as random 499/504 on the first requests after a container starts.

We're now initializing the request channel at declaration so early requests are served anyway once the first thread is started.

@dunglas dunglas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@henderkes henderkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but please don't use walls of LLM text for PR descriptions.

@ptondereau

Copy link
Copy Markdown
Contributor Author

Correct, but please don't use walls of LLM text for PR descriptions.

Edited with my own words, sorry 🙇‍♂️

@henderkes
henderkes merged commit 958bac6 into php:main Aug 20, 2026
13 checks passed
@ptondereau
ptondereau deleted the fix/early-request-nil-regular-request-chan branch August 20, 2026 07:08
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.

3 participants