Skip to content

Preserve activity tags across retry attempts - #263

Merged
andystaples merged 1 commit into
microsoft:mainfrom
TsuyoshiUshio:tsuyoshiushio-preserve-activity-retry-tags
Sep 4, 2026
Merged

Preserve activity tags across retry attempts#263
andystaples merged 1 commit into
microsoft:mainfrom
TsuyoshiUshio:tsuyoshiushio-preserve-activity-retry-tags

Conversation

@TsuyoshiUshio

@TsuyoshiUshio Tsuyoshi Ushio (TsuyoshiUshio) commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Activity tags are currently dropped when an activity is retried. This causes retry attempts to lose metadata such as durabletask.displayName, so dashboards fall back to the registered function name even though the initial attempt used the caller-provided display name.

Raw orchestration history demonstrates the symptom: the initial taskScheduled event contains durabletask.displayName, while retry-generated taskScheduled events contain an empty tags map.

image

Root cause

When a retry timer fires, the worker reconstructs the activity schedule action from the saved original action but forwards only its name and input. The saved tags are not passed to the reconstructed action.

Fix

Copy the saved Activity tag map into each reconstructed schedule action. This preserves durabletask.displayName and all other caller-provided Activity tags without changing sub-orchestration retry behavior.

Regression coverage

Added an orchestration executor test that schedules a tagged Activity with a retry policy, fails two attempts, fires both retry timers, and verifies every retry-generated ScheduleTaskAction retains the original tags.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 02:40

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.

🟢 Approval recommended

The change is narrowly scoped, includes a targeted regression test, and updates the changelog to reflect the user-visible behavior fix.

Pull request overview

This PR fixes a Durable Task Python SDK bug where ScheduleTaskAction tags (e.g., durabletask.displayName) were lost when an activity was rescheduled due to retries, causing retry attempts to drop caller-provided metadata.

Changes:

  • Preserve activity ScheduleTaskAction.tags when reconstructing activity schedule actions after a retry timer fires.
  • Add a regression test ensuring tags are retained for each retry-generated activity schedule action.
  • Document the user-visible bug fix in the root changelog under Unreleased.
File summaries
File Description
tests/durabletask/test_orchestration_executor.py Adds a regression test validating that activity tags persist across retry attempts.
durabletask/worker.py Copies tags from the saved original activity schedule action into the reconstructed retry schedule action.
CHANGELOG.md Records the fix under ## Unreleased as a user-visible behavior correction.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andystaples
andystaples merged commit 793fb14 into microsoft:main Sep 4, 2026
23 checks passed
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.

3 participants