Skip to content

[Scheduler] Restore WorkflowExecutionAlreadyStarted error for all CreateSchedule duplicate paths#9866

Merged
lina-temporal merged 1 commit intomainfrom
sched-already-running-fix
Apr 8, 2026
Merged

[Scheduler] Restore WorkflowExecutionAlreadyStarted error for all CreateSchedule duplicate paths#9866
lina-temporal merged 1 commit intomainfrom
sched-already-running-fix

Conversation

@lina-temporal
Copy link
Copy Markdown
Contributor

What changed?

  • Restored previous WorkflowExecutionAlreadyStarted error handling. CreateSchedule is special-cased in the SDK such that that specific error is wrapped into an application-level ScheduleAlreadyExists error.
  • CHASM handler still returns AlreadyExists, which is translated at the frontend handler level.

Why?

  • Broke backwards compatibility with the SDK

How did you test it?

New feature test to accompany this PR: temporalio/features#799

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)
  • added new feature test(s)

@lina-temporal lina-temporal requested a review from chaptersix April 8, 2026 17:40
@lina-temporal lina-temporal requested review from a team as code owners April 8, 2026 17:40
Comment on lines +3618 to +3619
return nil, serviceerror.NewWorkflowExecutionAlreadyStarted(
fmt.Sprintf("schedule %q: concurrent creation detected", request.ScheduleId), "", "")
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.

can you just return the original error in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I could, but then it wouldn't have the message indicating what had gone wrong (just the generic 'already started').

@lina-temporal lina-temporal merged commit 8e3de29 into main Apr 8, 2026
96 of 103 checks passed
@lina-temporal lina-temporal deleted the sched-already-running-fix branch April 8, 2026 18:18
tdyas pushed a commit that referenced this pull request Apr 8, 2026
…ateSchedule duplicate paths (#9866)

## What changed?
- Restored previous WorkflowExecutionAlreadyStarted error handling.
`CreateSchedule` is special-cased in the SDK such that that specific
error is wrapped into an application-level `ScheduleAlreadyExists`
error.
- CHASM handler still returns `AlreadyExists`, which is translated at
the frontend handler level.

## Why?
- Broke backwards compatibility with the SDK

## How did you test it?
**New feature test to accompany this PR**:
temporalio/features#799

- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
- [x] added new feature test(s)
@temporal-cicd temporal-cicd bot mentioned this pull request Apr 8, 2026
temporal-cicd bot pushed a commit that referenced this pull request Apr 8, 2026
…ateSchedule duplicate paths (#9866)

## What changed?
- Restored previous WorkflowExecutionAlreadyStarted error handling.
`CreateSchedule` is special-cased in the SDK such that that specific
error is wrapped into an application-level `ScheduleAlreadyExists`
error.
- CHASM handler still returns `AlreadyExists`, which is translated at
the frontend handler level.

## Why?
- Broke backwards compatibility with the SDK

## How did you test it?
**New feature test to accompany this PR**:
temporalio/features#799

- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
- [x] added new feature test(s)
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