Repository navigation
router: keep the caller's trace context across the resume flight detach - #1487
Merged
Tim Bai (baizhenyu) merged 1 commit intoSep 4, 2026
Merged
Tim Bai (baizhenyu) merged 1 commit into
Tim Bai (baizhenyu) merged 1 commit into
Conversation
The singleflight resume flight rebuilds its context from context.Background() so that a disconnecting caller cannot cancel the shared resume other parked requests are waiting on. That detach severed more than cancellation: it dropped the caller's span context, so the ateapi ResumeActor call started a fresh root trace, sampled independently of the ingress request. A sampled wake-on-request therefore produced a trace containing only the router's own spans, while the server-side resume work (step.*, atelet, snapshot fetch) landed in separate orphan traces — on a live install, a request that woke a suspended actor fragmented into three disconnected traces, and internal step spans showed up as trace roots. Carry the leader's SpanContext into the flight's background context. Cancellation stays detached; only trace identity crosses the boundary. Joiners share the leader's flight, so the flight carries the leader's trace — the accepted corollary of deduplicating onto one control-plane RPC per hot actor.
Da Huang (git286)
requested review from
Jeff Luo (JeffLuoo) and
Tim Bai (baizhenyu)
September 4, 2026 19:06
Tim Bai (baizhenyu)
approved these changes
Sep 4, 2026
Jeff Luo (JeffLuoo)
approved these changes
Sep 4, 2026
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.
The singleflight resume flight rebuilds its context from context.Background() so that a disconnecting caller cannot cancel the shared resume other parked requests are waiting on. That detach severed more than cancellation: it dropped the caller's span context, so the ateapi ResumeActor call started a fresh root trace, sampled independently of the ingress request. A sampled wake-on-request therefore produced a trace containing only the router's own spans, while the server-side resume work (step.*, atelet, snapshot fetch) landed in separate orphan traces — on a live install, a request that woke a suspended actor fragmented into three disconnected traces, and internal step spans showed up as trace roots.
Carry the leader's SpanContext into the flight's background context. Cancellation stays detached; only trace identity crosses the boundary. Joiners share the leader's flight, so the flight carries the leader's trace — the accepted corollary of deduplicating onto one control-plane RPC per hot actor.
Fixes #1486