Skip to content

fix(durablejobs): preserve trace context on retry - #10349

Open
ReubenBond wants to merge 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-durable-jobs-trace-id
Open

fix(durablejobs): preserve trace context on retry#10349
ReubenBond wants to merge 1 commit into
dotnet:mainfrom
ReubenBond:reubenbond-fix-durable-jobs-trace-id

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 7, 2026

Copy link
Copy Markdown
Member

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 14ae52f9-a827-4bf4-a4b6-3bf69b7e7631
Copilot AI review requested due to automatic review settings August 7, 2026 01:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TraceParent and TraceState when reconstructing a job during RetryJobLater rescheduling.
  • Add a focused regression test to verify trace context is preserved across retry rescheduling.
  • Extend the test helper CreateJob to 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants