Skip to content

Conversation

@Quinn-With-Two-Ns
Copy link
Contributor

Make CancellationScopeImpl more deterministic, our use of HashSet is not deterministic since we iterate over the map and the order matters her.

closes #2473

Copy link
Member

@cretz cretz May 8, 2025

Choose a reason for hiding this comment

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

Is there a test that confirms the HashSet is a problem? I figure it should assert task failure (can be done in loop like other test below since it doesn't always occur) and then when you enable the flag, can be altered to assert no task failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test I added fails if the flag is not set

Copy link
Member

@cretz cretz May 8, 2025

Choose a reason for hiding this comment

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

Ah I see now it's running a workflow, grabbing just-ran history, and doing that 100 times. I assume that's not too expensive of a test time wise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No takes about 5s

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 6c961a0 into temporalio:master May 9, 2025
9 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.

Cancellation scopes and async procedures are canceled in non-deterministic order when workflow is canceled

2 participants