Use collapse in `._root.open_root_actor()` too

Seems to add one more cancellation suite failure as well as now cause
the discovery test to error instead of fail?
strict_egs_everywhere
Tyler Goodlet 2025-06-16 15:34:04 -04:00
parent 9295af929c
commit f23ee3cd22
1 changed files with 18 additions and 6 deletions

View File

@ -64,6 +64,7 @@ from ._addr import (
) )
from .trionics import ( from .trionics import (
is_multi_cancelled, is_multi_cancelled,
collapse_eg,
) )
from ._exceptions import ( from ._exceptions import (
RuntimeFailure, RuntimeFailure,
@ -199,7 +200,11 @@ async def open_root_actor(
) -> Actor: ) -> Actor:
''' '''
Runtime init entry point for ``tractor``. Initialize the `tractor` runtime by starting a "root actor" in
a parent-most Python process.
All (disjoint) actor-process-trees-as-programs are created via
this entrypoint.
''' '''
# XXX NEVER allow nested actor-trees! # XXX NEVER allow nested actor-trees!
@ -442,10 +447,17 @@ async def open_root_actor(
) )
# start the actor runtime in a new task # start the actor runtime in a new task
async with trio.open_nursery( async with (
strict_exception_groups=False,
# ^XXX^ TODO? instead unpack any RAE as per "loose" style? # ?? TODO, causes test failures..
) as nursery: # - advanced_faults
# - cancellation
# - clustering
#
collapse_eg(),
trio.open_nursery() as root_tn,
# trio.open_nursery(strict_exception_groups=False) as root_tn,
):
# ``_runtime.async_main()`` creates an internal nursery # ``_runtime.async_main()`` creates an internal nursery
# and blocks here until any underlying actor(-process) # and blocks here until any underlying actor(-process)
@ -455,7 +467,7 @@ async def open_root_actor(
# "actor runtime" primitives are SC-compat and thus all # "actor runtime" primitives are SC-compat and thus all
# transitively spawned actors/processes must be as # transitively spawned actors/processes must be as
# well. # well.
await nursery.start( await root_tn.start(
partial( partial(
async_main, async_main,
actor, actor,