Skip to content

async and async-like builders cancel parent on failure #630

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
merged 1 commit into from
Sep 28, 2018
Merged

Conversation

elizarov
Copy link
Contributor

  • Affects async, CompletableDeferred, and all Rx integration builders.
  • This makes all coroutine builders totally consistent. They all
    cancel parent on failure, but they all consider "CancellationException"
    to be the case of "normal cancellation" that does not propagate to
    parent. The only missing case is Job() that should be fixed together
    with introduction of SupervisorJob().
  • Note that "scoping" builders don't "cancel the parent", but rethrow
    the corresponding exception instead, so it that is how it gets
    propagated up the stack.
  • This makes parallel decomposition exception-safe. You
    cannot loose an exception as along as default (child async)
    behavior is not overridden.

Fixes #552

@elizarov elizarov requested a review from qwwdfsad September 27, 2018 18:12
@elizarov elizarov force-pushed the async branch 2 times, most recently from f099444 to 5b18933 Compare September 27, 2018 18:27
* Affects async, CompletableDeferred, and all Rx integration builders.
* This makes all coroutine builders totally consistent. They all
  cancel parent on failure, but they all consider "CancellationException"
  to be the case of "normal cancellation" that does not propagate to
  parent. The only missing case is Job() that should be fixed together
  with introduction of SupervisorJob().
* Note that "scoping" builders don't "cancel the parent", but rethrow
  the corresponding exception instead, so it that is how it gets
  propagated up the stack.
* This makes parallel decomposition exception-safe. You
  cannot loose an exception as along as default (child async)
  behavior is not overridden.

Fixes #552
@elizarov elizarov merged commit 52bfdab into develop Sep 28, 2018
@elizarov elizarov deleted the async branch September 28, 2018 11:21
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.

2 participants