Commit 1a89f2e
Fix trace context leakage for secondary workers
Secondary workers were restoring trace context twice:
1. From invocation.traceparent (correct - from client)
2. From init_input.traceparent (redundant - from primary worker)
The second restore at line 1329 was problematic because:
- The trace_token was never detached, causing context leakage
- It overwrote the active context from invocation.traceparent
- This could cause spans to not appear under the expected trace
Since secondary workers already receive traceparent in the invocation
(which is the same one the client sent), the restore from init_input
is unnecessary. The init_input.traceparent is still stored for potential
use by workers that don't receive traceparent in the invocation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9843f3b commit 1a89f2e
1 file changed
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1333 | 1329 | | |
1334 | 1330 | | |
1335 | 1331 | | |
| |||
0 commit comments