Skip to content
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

Substantial mistake in documentation of Supervision #4004

Open
DorBSoft opened this issue Dec 29, 2023 · 0 comments
Open

Substantial mistake in documentation of Supervision #4004

DorBSoft opened this issue Dec 29, 2023 · 0 comments
Labels
bug guide Issues with the coroutines guide on the website

Comments

@DorBSoft
Copy link

DorBSoft commented Dec 29, 2023

/docs/topics/exception-handling.md

The "Supervision" section appears to be wrong throughout its text by using the term "cancellation" instead of the term "failure".
I.e. the text is suggesting it is about "cancel()", while it is actually about throwing any exception but "CancellationException".

"cancellation is a bidirectional relationship propagating through the whole hierarchy of coroutines.".
Wrong. "Failure is a bidirectional relationship...". "cancel()" is one-directional.

"It is similar to a regular Job with the only exception that cancellation is propagated only downwards."
Wrong.

If there is a need, the fact that cancel() is not bidirectional can be easily seen by doing the following changed in the example code:

val supervisor = coroutineContext//SupervisorJob()
...
cancel/throw AssertionError/("The first child is cancelled")
...
secondChild.join()//order replaced
supervisor.cancel()

@DorBSoft DorBSoft added the bug label Dec 29, 2023
@qwwdfsad qwwdfsad added the docs KDoc and API reference label Jan 18, 2024
@dkhalanskyjb dkhalanskyjb added guide Issues with the coroutines guide on the website and removed docs KDoc and API reference labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug guide Issues with the coroutines guide on the website
Projects
None yet
Development

No branches or pull requests

3 participants