Skip to content

Cancellation of TaskGroup should not trigger cancel handler of parent task #40562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rokhinip
Copy link
Contributor

Make sure that cancelling a task group does not invoke cancellation handler of parent task that created the group

Change comment in TaskGroup.swift such that only parent task can call cancelAll on the group

Add tests to verify mutating of task group in child tasks will fail

Radar-Id: rdar://problem/86346865

@rokhinip rokhinip requested review from ktoso and rjmccall December 15, 2021 01:31
@rokhinip
Copy link
Contributor Author

@swift-ci please test

@rokhinip rokhinip force-pushed the rokhinip/86346865-taskgroup-cancellAll-cancellationHandler branch from 3258b45 to d8b0aef Compare December 15, 2021 02:01
@rokhinip
Copy link
Contributor Author

@swift-ci please test

@ktoso
Copy link
Contributor

ktoso commented Dec 15, 2021

LGTM once:

  • we remove the badly named runtime test - this isn't "from child" anymore, and what this tests is tested somewhere else already
  • we rename the new test to say _from_child since that is the from child interaction that we want to ban

Thanks again for digging into this @rokhinip !

PS: You can just "smoke test" after the change is made, since the full test run takes ages and these are a small change 👍

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d8b0aef

@rokhinip
Copy link
Contributor Author

@swift-ci please test

@rokhinip rokhinip force-pushed the rokhinip/86346865-taskgroup-cancellAll-cancellationHandler branch from 9f36f03 to a680523 Compare December 17, 2021 08:35
@rokhinip
Copy link
Contributor Author

@swift-ci please test

@rokhinip rokhinip requested a review from ktoso December 17, 2021 08:36
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

LGTM, needs a rebase I think and adjusting the test since the group capture will fail now already I think?

@rokhinip rokhinip force-pushed the rokhinip/86346865-taskgroup-cancellAll-cancellationHandler branch from a680523 to 1fb7693 Compare December 18, 2021 02:25
@rokhinip
Copy link
Contributor Author

@swift-ci please smoke test and merge it

handler of parent task that created the group

Change comment in TaskGroup.swift to enforce that only parent task can
call cancelAll on the group

Add tests to verify mutating of task group in child tasks will fail

Radar-Id: rdar://problem/86346865
@rokhinip rokhinip force-pushed the rokhinip/86346865-taskgroup-cancellAll-cancellationHandler branch from 1fb7693 to 835f274 Compare December 18, 2021 02:35
@rokhinip
Copy link
Contributor Author

@swift-ci please smoke test and merge it

@rokhinip
Copy link
Contributor Author

@swift-ci please smoke test

@rokhinip
Copy link
Contributor Author

@swift-ci Please smoke test macOS platform

@rokhinip rokhinip merged commit 0f52bae into main Dec 22, 2021
@rokhinip rokhinip deleted the rokhinip/86346865-taskgroup-cancellAll-cancellationHandler branch December 22, 2021 02:32
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