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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptiongGroups and trio>=0.22 #333

Merged
merged 20 commits into from
Oct 15, 2022
Merged

ExceptiongGroups and trio>=0.22 #333

merged 20 commits into from
Oct 15, 2022

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Oct 9, 2022

Attempting to get the new py3.11 driven exception group backport support in. See pep 654 for dirty deats.

Pertains to fixing #332 and appears to have caused a bunch of test hangs particularly in the debugger suite (which I've manually verified) which need some investigation.

UPDATE tests now fixed with the landing of #337 馃弰馃徏

@goodboy goodboy added help wanted Extra attention is needed python_updates trio_updates keeping up to date with our parent labels Oct 9, 2022
@goodboy goodboy requested a review from guilledk October 11, 2022 15:04
@goodboy
Copy link
Owner Author

goodboy commented Oct 11, 2022

Beauty, now it's just some debugger test cases which are borked..

I've got a patch which solves this (as well as a general solution for the "un-contactable subactor left a stale lock state") but, it's going to require these the tests to be adjusted since they'll fail earlier now with less locks due to the new "block list" approach working.

@goodboy
Copy link
Owner Author

goodboy commented Oct 11, 2022

Hmm i might break out the new debugger fix stuff into a new dependent PR since it is somewhat unrelated to this specific change set.

Also might do the same for the uuid-in-log msgs adjustment?

@goodboy goodboy mentioned this pull request Oct 12, 2022
@goodboy goodboy changed the base branch from master to debug_lock_blocking October 12, 2022 00:40
@goodboy
Copy link
Owner Author

goodboy commented Oct 12, 2022

Alright factored out the relevant debugger locking solution stuff into #337.

Base automatically changed from debug_lock_blocking to master October 12, 2022 16:41
Turns out this test was being silently ignored due to incorrect usage of
sync opening of our `.open_nursery()` block (with a `with` not `async
with`) and thus was an noop XD

Instead this fixes the test to call a `tractor` discovery built-in
without starting the runtime (which is now done implicitly when a user
opens a nursery) which should result in the prior expected outcome,
a `RuntimeError`.
@goodboy goodboy changed the title Exceptiongroups and trio>=0.22 ExceptiongGroups and trio>=0.22 Oct 12, 2022
@goodboy
Copy link
Owner Author

goodboy commented Oct 14, 2022

馃挜 almost there!

Pretty sure this is the final touch to alleviate all our debug lock
headaches! Instead of trying to revert to the "last" handler (as `pdb`
does internally in the stdlib) we always just revert to the handler
`trio` registers during startup. Further this seems to allow cancelling
the root-side locking task if it's detected as stale IFF we only do this
when the root actor is in a "no more IPC peers" state.

Deatz:
- (always) set `._debug.Lock._trio_handler` as the `trio` version, not
  some last used handler to make sure we're getting the ctrl-c handling
  we want when not in debug mode.
- assign the trio handler in `open_root_actor()`
  `._runtime._async_main()` to be sure it's applied in subactors as well
  as the root.
- only do debug lock blocking and root-side-locking-task cancels when
  a "no peers" condition is detected in the root actor: i.e. no IPC
  channels are detected by the root meaning it's impossible any actor
  has a sane lock-state ongoing for debug mode.
@goodboy
Copy link
Owner Author

goodboy commented Oct 15, 2022

All the mega-deats in the nooz file 馃弰馃徏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed python_updates trio_updates keeping up to date with our parent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants