-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
make sure coroutine locals are promptly destroyed #1864
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1864 +/- ##
==========================================
+ Coverage 99.59% 99.64% +0.04%
==========================================
Files 114 114
Lines 14549 14569 +20
Branches 1110 1110
==========================================
+ Hits 14490 14517 +27
+ Misses 42 36 -6
+ Partials 17 16 -1
|
I totally meant to do a red-green test with these commits... yes... |
FWIW, I do think scattering |
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.
worth a newsfragment?
I think I got em all, but I would appreciate a double-check! |
would it be hard to expand tests to cover the additional explicit deletes? |
Well I haven't been able to come up with a good test so far, let me stew on it another week. Also TIL |
So just keeping track, the deletions of |
not sure how to trigger rebuild on sourcehut, will try close & re-open of PR |
0f105ca
to
8170b42
Compare
from MultiErrorCatcher.__exit__, _multierror.copy_tb, MultiError.filter, CancelScope.__exit__, and NurseryManager.__aexit__ methods. This was nearly impossible to catch until #1864 landed so it wasn't cleaned up in #1805 (or during the live stream: https://www.youtube.com/watch?v=E_jvJVYXUAk).
This PR fixes a "bug" where
unrolled_run
hangs on toCancelled
tracebacks too long. They essentially persist until the next exception is thrown out of a task, which may be an indefinite period of time. This was not cleaned up with the earlier cyclic garbage bugfix #1770 because it is not cyclic garbage; it's actually a strong reference that lives unnecessarily long.(Thinking out loud here) This is just the minimum possible fix. There are actually a number of locals akin to
final_outcome
inunrolled_run
that may live up to_MAX_TIMEOUT
seconds and contain references to tasks and potentially to hefty objects, but I haven't actually observed any issues along those lines yet. Scatteringdel
statements everywhere is probably untenable, but factoring chunks ofunrolled_run
into function calls would "automate" that kind of cleanup, at the cost of some overhead.