Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Bugfix suspended computation blocks #269

Merged
merged 4 commits into from Dec 16, 2020

Conversation

nomisRev
Copy link
Member

  1. KotlinX Coroutines throws CancellationException with cause when propagating cancellation by exception from async to it's parent. Since we cause the CancellationException with ShortCircuit we need to look if ShortCircuit can be found within the causes to return the excepted shifted value. If the cancellation is immediate, then it doesn't wrap in CancellationException, that caused the test to be flaky. Now it passes consitently on a loop.

  2. Suspended computation blocks were running on EmptyCoroutineContext, they need to run on the parents ctx to correctly propogate the state from outside to inside the computation block.

Copy link
Member

@raulraja raulraja left a comment

Choose a reason for hiding this comment

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

Thanks @nomisRev !

@raulraja raulraja requested a review from a team December 15, 2020 21:10
Copy link
Member

@i-walker i-walker left a comment

Choose a reason for hiding this comment

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

Thanks, @nomisRev for the nice explanation!

@rachelcarmena rachelcarmena merged commit 40a40c8 into master Dec 16, 2020
@rachelcarmena rachelcarmena deleted the sv-fix-context-fix-nested-exceptions branch December 16, 2020 09:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants