-
Notifications
You must be signed in to change notification settings - Fork 529
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
Handle self-cancellation when running fibers to avoid deadlocks #1484
Merged
djspiewak
merged 18 commits into
typelevel:series/3.x
from
wemrysi:feature/run-fiber-cancellation
Dec 18, 2020
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1c50ab5
Handle self-cancellation when running fibers
wemrysi 55d7427
Distinguish between cancellation and non-termination expectations in …
wemrysi e679495
Apply scalafmt
wemrysi c4fc7a6
Update to sbt-spiewak-sonatype-0.19.2
wemrysi d1ba17a
Ensure all cases implied by the generator hierarchy are produced
wemrysi 8e8cc4c
Enable GenSpawnLaws#raceNeverIdentityRight law
wemrysi 18e4369
Law: Raced effects don't inherit parent mask
wemrysi 77a650f
Remove laws that assert masking is inherited by raced fibers
wemrysi e104f9a
Race with F.never is not identity when other is canceled
wemrysi d152fd3
Disable raceCanceledIdentity laws
wemrysi 14bb4e2
Update async laws to reflect callback effect is uncancelable
wemrysi 87a3d6d
Disable roundtrip through scala Future test
wemrysi 751d075
Disable roundtrip through java CompletableFuture test
wemrysi 8098ca8
Disable memoize.flatten is identity test
wemrysi 40396b5
Rename Root -> Main in cancellation exception
wemrysi bd2a49a
Avoid unused warnings due to disabled tests
wemrysi f35d430
Avoid even more unused warnings due to disabled tests
wemrysi 5f2b59b
Merge branch 'series/3.x' into feature/run-fiber-cancellation
mpilquist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My rationale for the
uncancelable
is thatfu
is sequenced whenasync
is evaluated, but its cancellation status doesn't affect the outcome.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think it's cancelation status still affects the outcome.
fu = F.canceled
would still implyF.canceled
on both sides. Does this actually produce a different test outcome?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, good call, looks like I misinterpreted the failures before. Running the original laws again shows they fail when one side doesn't terminate and the other ends up as
canceled
. I'll have to investigate that more.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into this a bit more, I think this change is actually correct if we want to keep the current semantic that the effect returned from the async callback
is uncancelable (e.g. consider
fu = F.canceled >> F.never
).I think my use of the term "outcome" in the OP caused confusion.
fu
does affect the resultingOutcome
, but not the "outcome" in the sense that cancellation is suppressed.