Repository navigation
fix(core): unpublish a pool worker's inbox on every stop (#346) - #373
Merged
Merged
Conversation
Contributor
CoverageTotal lines: 83.91% → 83.97% (+0.06 pp)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #346.
A handler's
$server->stop()on a reactor-pool worker stopped that worker's clone and left its request inbox in the worker registry, so the reactors kept routing HTTP/3 requests to it, and the clone ran them after the stop, withisRunning()false, in the scopestart()was draining.do_stopnow unpublishes the inbox on every stop.start()fences the reactors after its wait (the retire the pool path already ran), and waits out a retire the pool coroutine still has in flight instead of freeing the server under it. The bailout and failed-wait exits, which cannot fence, unpublish before the free, andstart()does not publish when a stop already waits.The second case of the issue, a clone started again with the old inbox, is unreachable: the pool loads a fresh clone per worker run and starts it once, and a
start()from the clone's own handler throws before the inbox is published.Evidence.
h3/079(requests after a handler's stop): on main 6 to 10 of 16 answeredSTOPPED, 3 runs of 3; passes with the fix.h3/080(requests sent while the stopping handler holds its thread for 1 s): on main 6 to 7 of 16 answeredSTOPPED, 3 runs of 3; passes with the fix, and checks that answers arrive inside the window.do_stopfailsh3/080(2 runs of 2 over the 19 local pool tests). Dropping the fence instart()passes all of them: it covers a dispatch that loaded the inbox just before the unpublish, which no test widens.-j4: 522 of 525 run passed, 25 skipped. The 3 failures,h1/062toh1/064, fail on main the same way: the local PHP binary was built on 2026-09-26, before Pause a stopped listen event instead of accepting through it (#305) php-async#306, which they need.