Skip to content

sapi/fpm: Preserve poll event indexes after worker replacement - #452

Open
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-fpm-poll-slot-index-84
Open

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-fpm-poll-slot-index-84

Conversation

@iliaal

@iliaal iliaal commented Nov 2, 2026

Copy link
Copy Markdown
Owner

When worker replacement leaves the next poll slot occupied, FPM registers a descriptor in a different free slot but keeps the occupied index. The poll backend now records the slot it used, so readiness dispatch continues capturing worker output. Direct insertion and both removal paths already use the matching slot.

Found during code review and reproduced with PHP 8.4 FPM on Linux. The regression requires Linux's pipe-EOF ordering to exercise slot search. The separate queue traversal defect is handled in php#25154.

When the next poll slot is occupied, store the free slot found by the
search in the event and advance the hint from that slot. Otherwise the
readiness check uses the occupied slot and skips replacement worker output.
Direct insertion and both removal paths already use the matching slot.
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