Repository navigation
[Docs] Fix the fiber context recipe for event loops - #685
Merged
chr-hertel merged 3 commits intoNov 8, 2026
Merged
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
November 8, 2026 13:21
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The event-loop example calls run() on a Builder, causing an undefined-method error; it must call build() first.
1 open issue
What changed in this PR
This follow-up to #670 corrects the OpenTelemetry scope-lifetime recipe for event-loop requests and expands fiber-context regression coverage.
Changes:
- Retain the activated scope and detach it in
finally. - Cover abandoned streams and failing
wrap()calls across all three server modes. - Rename the stdio test to reflect the fiber-context API.
| File | Description |
|---|---|
tests/Unit/Server/Fiber/FiberContextTest.php |
Expand cleanup and failure coverage; rename the stdio test. |
tests/Unit/Fixtures/RecordingFiberContext.php |
Allow simulated wrap() failures. |
docs/run/server-builder.md |
Document scope retention and cleanup under event loops. |
Review effort: Balanced
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.

Follow-up to #670
Context::getRoot()->activate()with a discarded scope raises a notice as soon as PHP assertions are on - that is anErrorExceptionin Symfony's debug mode, same setup as [Server] Handler fibers give integrations no hook to carry OpenTelemetry's context #583. The recipe now keeps the scope & detaches it infinallybuildStateless(), now all three modes, plus a failingwrap()and a leftover test name