Skip to content

Conversation

@chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Jan 2, 2026

What was changed

No longer call AsyncLocalStorage.disable for the stores used to track cancellation and update scopes.

Why?

  • condition with timeout creates a CancellationScope to perform the race between the sleep and the blocking condition src
  • On completion, the current CancellationScope is canceled
  • Current CancellationScope is stored in a AsyncLocalStorage which falls back to the workflow cancellation scope if not in a context where there is an active store. src
  • 1834 added a workflowModule.dispose() call to the dispose method for reusable VM workflow
  • This in turn disables the AsyncLocalStorage that stores the cancellation tokens (src). Any subsequent getStore calls that happen before a new run will return undefined.
  • If a workflow ends up getting disposed after the condition scope is created, but before the scope is cancelled, then the workflow ends up get cancelled instead of the condition scope.
  • This lines up from the trace provided by the user on 1866 which is a CancelledFailure: Workflow cancelled, but coming from the cancel inside of the condition scope on this line

Checklist

  1. Closes [Bug] Signal caused condition to fail with CancelledFailure on 1.14.0 #1866

  2. How was this tested:
    Added failing integration test in first commit, second commit fixes the test.

  3. Any docs updates needed?
    N/A

@chris-olszewski chris-olszewski marked this pull request as ready for review January 5, 2026 14:22
@chris-olszewski chris-olszewski requested a review from a team as a code owner January 5, 2026 14:22
export class VMWorkflow extends BaseVMWorkflow {
public async dispose(): Promise<void> {
this.workflowModule.dispose();
this.workflowModule.destroy();
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding back the disableStore/disableUpdateStore calls that were present in dispose before this PR.

if (this._context) {
vm.runInContext(
`{
__TEMPORAL__.api.destroy();
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if there's a better way to call this

@mjameswh
Copy link
Contributor

mjameswh commented Jan 8, 2026

Superseded by #1871.

@mjameswh mjameswh closed this Jan 8, 2026
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.

[Bug] Signal caused condition to fail with CancelledFailure on 1.14.0

3 participants