-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
[docs] clarify checkpoint semantics for trio.open_nursery #3011
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -993,7 +993,8 @@ def open_nursery( | |
new `Nursery`. | ||
|
||
It does not block on entry; on exit it blocks until all child tasks | ||
have exited. | ||
have exited. If no child tasks are running on exit, it will insert a | ||
schedule point (but no cancellation point). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is unique behaviour, maybe it'd be good to add an additional sentence explaining why this is the case - something like "A nursery is never the source of the cancellation exception, it only propagates it from sub-tasks." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh actually, is that not functionally the same as https://trio.readthedocs.io/en/stable/reference-lowlevel.html#trio.lowlevel.cancel_shielded_checkpoint ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think just referring to that builds any kind of intuition for why open_nursery is a special case. In fact I forgot the exact wording/problem that convinced me, but I think it was some message on the gitter (that pushed the old PR to be merged). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed a small commit that both refers to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not exactly, but I think docs as is are good enough:tm: |
||
|
||
Args: | ||
strict_exception_groups (bool): Unless set to False, even a single raised exception | ||
|
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.
Not sure if this is needed, I think the
Partial exception for async context managers
block handles thisThere 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.
It may be overkill, but
open_nursery
in itself as a context manager doesn't guarantee a full checkpoint on either of entry or exit - so imo it doesn't abide by the special rules in thePartial exception for async context managers
block. There's some more discussion around this in #1457