fix(durablejobs): preserve trace context on retry - #10349
Open
ReubenBond wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14ae52f9-a827-4bf4-a4b6-3bf69b7e7631
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a tracing continuity bug in the durable jobs in-memory queue by ensuring W3C trace context (both traceparent and tracestate) is preserved when a queued job is rescheduled for retry. This aligns retry behavior with the persisted job data so subsequent attempts continue the original distributed trace.
Changes:
- Copy
TraceParentandTraceStatewhen reconstructing a job duringRetryJobLaterrescheduling. - Add a focused regression test to verify trace context is preserved across retry rescheduling.
- Extend the test helper
CreateJobto allow specifying trace context fields.
Show a summary per file
| File | Description |
|---|---|
| src/Orleans.DurableJobs/InMemoryJobQueue.cs | Preserves TraceParent/TraceState when rebuilding a job during retry rescheduling. |
| test/Orleans.Core.Tests/DurableJobs/InMemoryJobQueueTests.cs | Adds regression coverage for trace context preservation and updates the job factory helper to set trace fields. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
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.
Durable job retries reconstructed the queued job without copying its persisted W3C trace context. When an attempt was retried, subsequent execution therefore started a new trace and caused the tracing continuity test to fail under load.\n\nPreserve both traceparent and tracestate when rescheduling an in-memory job, with a focused regression test for retry context preservation.
Microsoft Reviewers: Open in CodeFlow