fix(durablejobs): preserve job state across retries - #10349
Merged
ReubenBond merged 2 commits intoAug 7, 2026
Merged
Conversation
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
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14ae52f9-a827-4bf4-a4b6-3bf69b7e7631
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14ae52f9-a827-4bf4-a4b6-3bf69b7e7631
ReubenBond
force-pushed
the
reubenbond-fix-durable-jobs-trace-id
branch
from
August 7, 2026 15:42
169d85a to
356bd5f
Compare
This was referenced Aug 28, 2026
Merged
This was referenced Sep 7, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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, so a retried execution could start an unrelated trace.
Preserve trace context when rescheduling in-memory jobs. Also pass the complete
DurableJobandIJobRunContextthrough the publicJobShardpersistence hooks so custom persistent shards cannot lose trace fields or dequeue state across reloads and reassignment. Add focused coverage for both paths.