Skip to content

Fix SignalWithStart hang on orphaned current-execution pointer - #11774

Open
ryancocuzzo wants to merge 1 commit into
temporalio:mainfrom
ryancocuzzo:fix/workflow-signal-with-start-orphan-pointer
Open

Fix SignalWithStart hang on orphaned current-execution pointer#11774
ryancocuzzo wants to merge 1 commit into
temporalio:mainfrom
ryancocuzzo:fix/workflow-signal-with-start-orphan-pointer

Conversation

@ryancocuzzo

Copy link
Copy Markdown

Fixes #10841

What changed?

On a BrandNew conflict against a completed current row, overwrite it with UpdateCurrent. Same recovery StartWorkflow already has. Reuse policy still runs. Running conflicts still return CurrentWorkflowConditionFailedError.

Why?

Cassandra can leave current_executions pointing at a run whose mutable state is gone. SignalWithStart treats that as "no current workflow", BrandNew loses the CAS, and the history handler retries that error with no backoff until the client deadline.
That retry exists for concurrent starts. In this case it never succeeds. The reporter unstuck themselves with admin DeleteWorkflowExecution — that one actually removes the pointer.
SQL doesn't hang here. The lock query inner-joins executions, so the orphan is invisible and you get a unique constraint instead.

How did you tt it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)
    Unit tests cover the happy path (TIMED_OUT pointer → new run), REJECT_DUPLICATE, and leaving a running conflict alone.
    Cassandra functional test: complete a workflow, delete mutable state while leaving the pointer, CloseShard so cache can't hide it, SignalWithStart with a 10s timeout. Used to wait out the deadline.

Potential risks

Overwriting a running current row would break concurrent SignalWithStart. We don't.
Not touching the handler retry loop, and not changing SQL in this PR.

@ryancocuzzo
ryancocuzzo marked this pull request as ready for review August 25, 2026 06:24
@ryancocuzzo
ryancocuzzo requested a review from a team August 25, 2026 06:24
@ryancocuzzo
ryancocuzzo requested review from a team as code owners August 25, 2026 06:24
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.

SignalWithStart hangs forever on an orphaned current-execution pointer

1 participant