Flip to `strict_exception_groups=False` in core tns
Since it'll likely need a bit of detailing to get the test suite running identically with strict egs (exception groups), i've opted to just flip the switch on a few core nursery scopes for now until as such a time i can focus enough to port the matching internals.. Xppy313_support
parent
cb8c726012
commit
a86774c40f
|
@ -1982,7 +1982,10 @@ async def open_context_from_portal(
|
|||
ctxc_from_callee: ContextCancelled|None = None
|
||||
try:
|
||||
async with (
|
||||
trio.open_nursery() as tn,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
) as tn,
|
||||
|
||||
msgops.maybe_limit_plds(
|
||||
ctx=ctx,
|
||||
spec=ctx_meta.get('pld_spec'),
|
||||
|
|
|
@ -362,7 +362,10 @@ async def open_root_actor(
|
|||
)
|
||||
|
||||
# start the actor runtime in a new task
|
||||
async with trio.open_nursery() as nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as nursery:
|
||||
|
||||
# ``_runtime.async_main()`` creates an internal nursery
|
||||
# and blocks here until any underlying actor(-process)
|
||||
|
@ -457,12 +460,19 @@ def run_daemon(
|
|||
|
||||
start_method: str | None = None,
|
||||
debug_mode: bool = False,
|
||||
|
||||
# TODO, support `infected_aio=True` mode by,
|
||||
# - calling the appropriate entrypoint-func from `.to_asyncio`
|
||||
# - maybe init-ing `greenback` as done above in
|
||||
# `open_root_actor()`.
|
||||
|
||||
**kwargs
|
||||
|
||||
) -> None:
|
||||
'''
|
||||
Spawn daemon actor which will respond to RPC; the main task simply
|
||||
starts the runtime and then sleeps forever.
|
||||
Spawn a root (daemon) actor which will respond to RPC; the main
|
||||
task simply starts the runtime and then blocks via embedded
|
||||
`trio.sleep_forever()`.
|
||||
|
||||
This is a very minimal convenience wrapper around starting
|
||||
a "run-until-cancelled" root actor which can be started with a set
|
||||
|
@ -475,7 +485,6 @@ def run_daemon(
|
|||
importlib.import_module(path)
|
||||
|
||||
async def _main():
|
||||
|
||||
async with open_root_actor(
|
||||
registry_addrs=registry_addrs,
|
||||
name=name,
|
||||
|
|
|
@ -621,7 +621,11 @@ async def _invoke(
|
|||
tn: trio.Nursery
|
||||
rpc_ctx_cs: CancelScope
|
||||
async with (
|
||||
trio.open_nursery() as tn,
|
||||
trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
|
||||
) as tn,
|
||||
msgops.maybe_limit_plds(
|
||||
ctx=ctx,
|
||||
spec=ctx_meta.get('pld_spec'),
|
||||
|
@ -734,8 +738,8 @@ async def _invoke(
|
|||
# XXX: do we ever trigger this block any more?
|
||||
except (
|
||||
BaseExceptionGroup,
|
||||
trio.Cancelled,
|
||||
BaseException,
|
||||
trio.Cancelled,
|
||||
|
||||
) as scope_error:
|
||||
if (
|
||||
|
|
|
@ -395,7 +395,10 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
|||
# `ActorNursery.start_actor()`).
|
||||
|
||||
# errors from this daemon actor nursery bubble up to caller
|
||||
async with trio.open_nursery() as da_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as da_nursery:
|
||||
try:
|
||||
# This is the inner level "run in actor" nursery. It is
|
||||
# awaited first since actors spawned in this way (using
|
||||
|
@ -405,7 +408,10 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
|||
# immediately raised for handling by a supervisor strategy.
|
||||
# As such if the strategy propagates any error(s) upwards
|
||||
# the above "daemon actor" nursery will be notified.
|
||||
async with trio.open_nursery() as ria_nursery:
|
||||
async with trio.open_nursery(
|
||||
strict_exception_groups=False,
|
||||
# ^XXX^ TODO? instead unpack any RAE as per "loose" style?
|
||||
) as ria_nursery:
|
||||
|
||||
an = ActorNursery(
|
||||
actor,
|
||||
|
|
Loading…
Reference in New Issue