Repository navigation
Conversation
Signed-off-by: bbdu3 <ergouyang854@gamil.com>
bbdu3
requested review from
CodeWithKyrian,
Nyholm,
chr-hertel and
soyuka
as code owners
November 5, 2026 09:56
This branch has not been deployed
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.
Summary
Add an optional integration point for propagating execution context into SDK-managed handler fibers.
With OpenTelemetry’s default fiber-bound storage, accessing context inside an uninitialized handler fiber raises a warning. When an application converts warnings into exceptions, the request fails with
-32603. This fix allows applications to configure context propagation explicitly; it does not enable OpenTelemetry integration automatically.Fixes #583
Changed
FiberFactoryInterfaceandBuilder::setFiberFactory(), wired intoProtocolandStatelessProtocol, includingbuildStateless().finally. Default fiber-bound storage retains the context across suspension and resumption, avoiding additional lifecycle hooks at eachstart()orresume().PR #616 addresses #615 by coordinating fiber execution with an external event loop. This PR addresses context propagation and leaves scheduling unchanged. Both touch handler-fiber creation, so combining them may require adapting the factory’s integration point; their combined implementation has not been tested.
Test
buildStateless(), HTTP and stdio, interleaved requests, suspension/resumption, handler exceptions, and cleanup when suspended fibers are discarded.open-telemetry/context1.5.0 passed 12 before/after scenarios with warnings promoted to exceptions. The default configuration reproduced the reported failure; the configured factory preserved context and completed cleanup without those warnings.