2021-12-13 18:08:32 +00:00
|
|
|
# tractor: structured concurrent "actors".
|
|
|
|
|
# Copyright 2018-eternity Tyler Goodlet.
|
|
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
2019-03-05 23:52:19 +00:00
|
|
|
"""
|
2026-04-17 23:03:00 +00:00
|
|
|
Top level routines & machinery for actor-as-process/subint spawning
|
|
|
|
|
over multiple backends.
|
2021-10-14 03:33:31 +00:00
|
|
|
|
2019-03-05 23:52:19 +00:00
|
|
|
"""
|
2022-02-16 17:08:35 +00:00
|
|
|
from __future__ import annotations
|
2023-06-14 19:32:15 +00:00
|
|
|
import multiprocessing as mp
|
2020-01-20 16:10:51 +00:00
|
|
|
import platform
|
2021-12-02 17:34:27 +00:00
|
|
|
from typing import (
|
2022-10-09 19:09:14 +00:00
|
|
|
Any,
|
2023-05-14 23:31:50 +00:00
|
|
|
Awaitable,
|
2022-10-09 20:05:40 +00:00
|
|
|
Literal,
|
2022-10-09 19:09:14 +00:00
|
|
|
Callable,
|
|
|
|
|
TypeVar,
|
|
|
|
|
TYPE_CHECKING,
|
2021-12-02 17:34:27 +00:00
|
|
|
)
|
2020-01-12 02:37:30 +00:00
|
|
|
|
|
|
|
|
import trio
|
2024-03-13 22:41:24 +00:00
|
|
|
from trio import TaskStatus
|
2019-11-26 14:23:37 +00:00
|
|
|
|
Mv `trio_proc`/`mp_proc` to per-backend submods
Split the monolithic `spawn._spawn` into a slim
"core" + per-backend submodules so a future
`._subint` backend (per issue #379) can drop in
without piling more onto `_spawn.py`.
`._spawn` retains the cross-backend supervisor
machinery: `SpawnMethodKey`, `_methods` registry,
`_spawn_method`/`_ctx` state, `try_set_start_method()`,
the `new_proc()` dispatcher, and the shared helpers
`exhaust_portal()`, `cancel_on_completion()`,
`hard_kill()`, `soft_kill()`, `proc_waiter()`.
Deats,
- mv `trio_proc()` → new `spawn._trio`
- mv `mp_proc()` → new `spawn._mp`, reads `_ctx` and
`_spawn_method` via `from . import _spawn` for
late binding bc both get mutated by
`try_set_start_method()`
- `_methods` wires up the new submods via late
bottom-of-module imports to side-step circular
dep (both backend mods pull shared helpers from
`._spawn`)
- prune now-unused imports from `_spawn.py` — `sys`,
`is_root_process`, `current_actor`,
`is_main_process`, `_mp_main`, `ActorFailure`,
`pretty_struct`, `_pformat`
Also,
- `_testing.pytest.pytest_generate_tests()` now
drives the valid-backend set from
`typing.get_args(SpawnMethodKey)` so adding a
new backend (e.g. `'subint'`) doesn't require
touching the harness
- refresh `spawn/__init__.py` docstring for the
new layout
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-04-17 05:58:05 +00:00
|
|
|
from ..devx import debug
|
Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs
Restructure the flat `tractor/` top-level private mods
into (more nested) subpackages:
- `runtime/`: `_runtime`, `_portal`, `_rpc`, `_state`,
`_supervise`
- `spawn/`: `_spawn`, `_entry`, `_forkserver_override`,
`_mp_fixup_main`
- `discovery/`: `_addr`, `_discovery`, `_multiaddr`
Each subpkg `__init__.py` is kept lazy (no eager
imports) to avoid circular import issues.
Also,
- update all intra-pkg imports across ~35 mods to use
the new subpkg paths (e.g. `from .runtime._state`
instead of `from ._state`)
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-23 22:42:16 +00:00
|
|
|
from tractor.runtime._state import (
|
2024-05-22 19:21:01 +00:00
|
|
|
_runtime_vars,
|
2021-06-26 00:52:08 +00:00
|
|
|
)
|
2024-03-13 22:41:24 +00:00
|
|
|
from tractor.log import get_logger
|
2026-05-04 14:51:01 +00:00
|
|
|
from tractor.discovery._addr import (
|
|
|
|
|
UnwrappedAddress,
|
|
|
|
|
)
|
|
|
|
|
from ._reap import unlink_uds_bind_addrs
|
Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs
Restructure the flat `tractor/` top-level private mods
into (more nested) subpackages:
- `runtime/`: `_runtime`, `_portal`, `_rpc`, `_state`,
`_supervise`
- `spawn/`: `_spawn`, `_entry`, `_forkserver_override`,
`_mp_fixup_main`
- `discovery/`: `_addr`, `_discovery`, `_multiaddr`
Each subpkg `__init__.py` is kept lazy (no eager
imports) to avoid circular import issues.
Also,
- update all intra-pkg imports across ~35 mods to use
the new subpkg paths (e.g. `from .runtime._state`
instead of `from ._state`)
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-23 22:42:16 +00:00
|
|
|
from tractor.runtime._portal import Portal
|
|
|
|
|
from tractor.runtime._runtime import Actor
|
Mv `trio_proc`/`mp_proc` to per-backend submods
Split the monolithic `spawn._spawn` into a slim
"core" + per-backend submodules so a future
`._subint` backend (per issue #379) can drop in
without piling more onto `_spawn.py`.
`._spawn` retains the cross-backend supervisor
machinery: `SpawnMethodKey`, `_methods` registry,
`_spawn_method`/`_ctx` state, `try_set_start_method()`,
the `new_proc()` dispatcher, and the shared helpers
`exhaust_portal()`, `cancel_on_completion()`,
`hard_kill()`, `soft_kill()`, `proc_waiter()`.
Deats,
- mv `trio_proc()` → new `spawn._trio`
- mv `mp_proc()` → new `spawn._mp`, reads `_ctx` and
`_spawn_method` via `from . import _spawn` for
late binding bc both get mutated by
`try_set_start_method()`
- `_methods` wires up the new submods via late
bottom-of-module imports to side-step circular
dep (both backend mods pull shared helpers from
`._spawn`)
- prune now-unused imports from `_spawn.py` — `sys`,
`is_root_process`, `current_actor`,
`is_main_process`, `_mp_main`, `ActorFailure`,
`pretty_struct`, `_pformat`
Also,
- `_testing.pytest.pytest_generate_tests()` now
drives the valid-backend set from
`typing.get_args(SpawnMethodKey)` so adding a
new backend (e.g. `'subint'`) doesn't require
touching the harness
- refresh `spawn/__init__.py` docstring for the
new layout
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-04-17 05:58:05 +00:00
|
|
|
from tractor.msg import types as msgtypes
|
2020-01-20 16:10:51 +00:00
|
|
|
|
2019-03-05 23:52:19 +00:00
|
|
|
|
2022-02-16 17:08:35 +00:00
|
|
|
if TYPE_CHECKING:
|
Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs
Restructure the flat `tractor/` top-level private mods
into (more nested) subpackages:
- `runtime/`: `_runtime`, `_portal`, `_rpc`, `_state`,
`_supervise`
- `spawn/`: `_spawn`, `_entry`, `_forkserver_override`,
`_mp_fixup_main`
- `discovery/`: `_addr`, `_discovery`, `_multiaddr`
Each subpkg `__init__.py` is kept lazy (no eager
imports) to avoid circular import issues.
Also,
- update all intra-pkg imports across ~35 mods to use
the new subpkg paths (e.g. `from .runtime._state`
instead of `from ._state`)
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-23 22:42:16 +00:00
|
|
|
from tractor.ipc import (
|
2025-07-07 23:11:01 +00:00
|
|
|
Channel,
|
|
|
|
|
)
|
Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs
Restructure the flat `tractor/` top-level private mods
into (more nested) subpackages:
- `runtime/`: `_runtime`, `_portal`, `_rpc`, `_state`,
`_supervise`
- `spawn/`: `_spawn`, `_entry`, `_forkserver_override`,
`_mp_fixup_main`
- `discovery/`: `_addr`, `_discovery`, `_multiaddr`
Each subpkg `__init__.py` is kept lazy (no eager
imports) to avoid circular import issues.
Also,
- update all intra-pkg imports across ~35 mods to use
the new subpkg paths (e.g. `from .runtime._state`
instead of `from ._state`)
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-23 22:42:16 +00:00
|
|
|
from tractor.runtime._supervise import ActorNursery
|
2022-02-16 17:08:35 +00:00
|
|
|
ProcessType = TypeVar('ProcessType', mp.Process, trio.Process)
|
|
|
|
|
|
2025-04-11 20:55:03 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
log = get_logger('tractor')
|
2019-03-05 23:52:19 +00:00
|
|
|
|
2020-02-08 01:01:41 +00:00
|
|
|
# placeholder for an mp start context if so using that backend
|
2023-05-14 23:31:50 +00:00
|
|
|
_ctx: mp.context.BaseContext | None = None
|
2022-10-09 20:05:40 +00:00
|
|
|
SpawnMethodKey = Literal[
|
2022-10-09 21:54:55 +00:00
|
|
|
'trio', # supported on all platforms
|
|
|
|
|
'mp_spawn',
|
|
|
|
|
'mp_forkserver', # posix only
|
2022-10-09 20:05:40 +00:00
|
|
|
]
|
|
|
|
|
_spawn_method: SpawnMethodKey = 'trio'
|
2019-03-06 05:29:07 +00:00
|
|
|
|
|
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
if platform.system() == 'Windows':
|
2020-11-16 05:16:09 +00:00
|
|
|
|
2020-02-08 01:01:41 +00:00
|
|
|
_ctx = mp.get_context("spawn")
|
|
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
async def proc_waiter(proc: mp.Process) -> None:
|
2020-07-20 19:18:38 +00:00
|
|
|
await trio.lowlevel.WaitForSingleObject(proc.sentinel)
|
2020-01-20 16:10:51 +00:00
|
|
|
else:
|
2020-11-16 05:16:09 +00:00
|
|
|
# *NIX systems use ``trio`` primitives as our default as well
|
2020-01-23 06:23:26 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
async def proc_waiter(proc: mp.Process) -> None:
|
2020-07-20 19:18:38 +00:00
|
|
|
await trio.lowlevel.wait_readable(proc.sentinel)
|
2020-01-20 16:10:51 +00:00
|
|
|
|
|
|
|
|
|
2022-10-09 20:05:40 +00:00
|
|
|
def try_set_start_method(
|
2022-10-09 21:54:55 +00:00
|
|
|
key: SpawnMethodKey
|
2022-10-09 20:05:40 +00:00
|
|
|
|
2023-05-14 23:31:50 +00:00
|
|
|
) -> mp.context.BaseContext | None:
|
2021-12-22 19:53:36 +00:00
|
|
|
'''
|
|
|
|
|
Attempt to set the method for process starting, aka the "actor
|
2020-01-31 17:05:15 +00:00
|
|
|
spawning backend".
|
2019-03-06 05:29:07 +00:00
|
|
|
|
2020-07-25 16:00:04 +00:00
|
|
|
If the desired method is not supported this function will error.
|
|
|
|
|
On Windows only the ``multiprocessing`` "spawn" method is offered
|
|
|
|
|
besides the default ``trio`` which uses async wrapping around
|
|
|
|
|
``subprocess.Popen``.
|
2021-12-22 19:53:36 +00:00
|
|
|
|
|
|
|
|
'''
|
2022-02-16 17:08:35 +00:00
|
|
|
import multiprocessing as mp
|
2019-03-06 05:29:07 +00:00
|
|
|
global _ctx
|
2020-01-23 06:15:46 +00:00
|
|
|
global _spawn_method
|
2019-03-06 05:29:07 +00:00
|
|
|
|
2022-10-09 21:54:55 +00:00
|
|
|
mp_methods = mp.get_all_start_methods()
|
|
|
|
|
if 'fork' in mp_methods:
|
2020-01-31 17:05:15 +00:00
|
|
|
# forking is incompatible with ``trio``s global task tree
|
2022-10-09 21:54:55 +00:00
|
|
|
mp_methods.remove('fork')
|
2019-03-06 05:29:07 +00:00
|
|
|
|
2022-10-09 21:54:55 +00:00
|
|
|
match key:
|
|
|
|
|
case 'mp_forkserver':
|
|
|
|
|
from . import _forkserver_override
|
|
|
|
|
_forkserver_override.override_stdlib()
|
|
|
|
|
_ctx = mp.get_context('forkserver')
|
2020-01-23 06:15:46 +00:00
|
|
|
|
2022-10-09 21:54:55 +00:00
|
|
|
case 'mp_spawn':
|
|
|
|
|
_ctx = mp.get_context('spawn')
|
2022-10-09 20:05:40 +00:00
|
|
|
|
2022-10-09 21:54:55 +00:00
|
|
|
case 'trio':
|
|
|
|
|
_ctx = None
|
2019-03-06 05:29:07 +00:00
|
|
|
|
2022-10-09 21:54:55 +00:00
|
|
|
case _:
|
|
|
|
|
raise ValueError(
|
|
|
|
|
f'Spawn method `{key}` is invalid!\n'
|
|
|
|
|
f'Please choose one of {SpawnMethodKey}'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
_spawn_method = key
|
2019-03-06 05:29:07 +00:00
|
|
|
return _ctx
|
2019-03-05 23:52:19 +00:00
|
|
|
|
|
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
async def exhaust_portal(
|
2021-11-20 18:01:22 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
portal: Portal,
|
|
|
|
|
actor: Actor
|
2021-11-20 18:01:22 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
) -> Any:
|
2021-11-20 18:01:22 +00:00
|
|
|
'''
|
|
|
|
|
Pull final result from portal (assuming it has one).
|
2020-01-20 16:10:51 +00:00
|
|
|
|
|
|
|
|
If the main task is an async generator do our best to consume
|
|
|
|
|
what's left of it.
|
2021-11-20 18:01:22 +00:00
|
|
|
'''
|
2022-10-12 21:41:01 +00:00
|
|
|
__tracebackhide__ = True
|
2020-01-20 16:10:51 +00:00
|
|
|
try:
|
2024-05-09 19:20:03 +00:00
|
|
|
log.debug(
|
Use `.aid.uid` to avoid deprecation warns
I started getting annoyed by all the warnings from `pytest` during work
on macos suport in CI, so this replaces all `Actor.uid`/`Channel.uid`
accesses with `.aid.uid` (or `.aid.reprol()` for log msgs) across the
core runtime and IPC subsystems to avoid the noise.
This also provides incentive to start the adjustment to all
`.uid`-holding/tracking internal `dict`-tables/data-structures to
instead use `.msg.types.Aid`. Hopefully that will come a (vibed?) follow
up shortly B)
Deats,
- `._context`: swap all `self._actor.uid`, `self.chan.uid`,
and `portal.actor.uid` refs to `.aid.uid`; use
`.aid.reprol()` for log/error formatting.
- `._rpc`: same treatment for `actor.uid`, `chan.uid` in
log msgs and cancel-scope handling; fix `str(err)` typo
in `ContextCancelled` log.
- `._runtime`: update `chan.uid` -> `chan.aid.uid` in ctx
cache lookups, RPC `Start` msg, registration and
cancel-request handling; improve ctxc log formatting.
- `._spawn`: replace all `subactor.uid` with
`.aid.uid` for child-proc tracking, IPC peer waiting,
debug-lock acquisition, and nursery child dict ops.
- `._supervise`: same for `subactor.uid` in cancel and
portal-wait paths; use `actor.aid.uid` for error dict.
- `._state`: fix `last.uid` -> `last.aid.uid` in
`current_actor()` error msg.
Also,
- `._chan`: make `Channel.aid` a proper `@property` backed
by `._aid` so we can add validation/typing later.
- `.log`: use `current_actor().aid.uuid` instead of
`.uid[1]` for actor-uid log field.
- `.msg.types`: add TODO comment for `Start.aid` field
conversion.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-08 19:27:48 +00:00
|
|
|
f'Waiting on final result from {actor.aid.uid}'
|
2024-05-09 19:20:03 +00:00
|
|
|
)
|
2021-04-28 15:38:10 +00:00
|
|
|
|
|
|
|
|
# XXX: streams should never be reaped here since they should
|
|
|
|
|
# always be established and shutdown using a context manager api
|
2024-06-27 20:25:46 +00:00
|
|
|
final: Any = await portal.wait_for_result()
|
2021-04-28 15:38:10 +00:00
|
|
|
|
2022-10-09 17:12:50 +00:00
|
|
|
except (
|
|
|
|
|
Exception,
|
|
|
|
|
BaseExceptionGroup,
|
|
|
|
|
) as err:
|
|
|
|
|
# we reraise in the parent task via a ``BaseExceptionGroup``
|
2020-01-20 16:10:51 +00:00
|
|
|
return err
|
2024-02-20 18:12:51 +00:00
|
|
|
|
2020-10-13 03:28:36 +00:00
|
|
|
except trio.Cancelled as err:
|
|
|
|
|
# lol, of course we need this too ;P
|
|
|
|
|
# TODO: merge with above?
|
2024-02-20 18:12:51 +00:00
|
|
|
log.warning(
|
|
|
|
|
'Cancelled portal result waiter task:\n'
|
2025-04-03 17:19:19 +00:00
|
|
|
f'uid: {portal.channel.aid}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
f'error: {err}\n'
|
|
|
|
|
)
|
2020-10-13 03:28:36 +00:00
|
|
|
return err
|
2024-02-20 18:12:51 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
else:
|
2024-02-20 18:12:51 +00:00
|
|
|
log.debug(
|
|
|
|
|
f'Returning final result from portal:\n'
|
2025-04-03 17:19:19 +00:00
|
|
|
f'uid: {portal.channel.aid}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
f'result: {final}\n'
|
|
|
|
|
)
|
2020-01-20 16:10:51 +00:00
|
|
|
return final
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def cancel_on_completion(
|
2021-11-20 18:01:22 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
portal: Portal,
|
|
|
|
|
actor: Actor,
|
2022-02-16 17:08:35 +00:00
|
|
|
errors: dict[tuple[str, str], Exception],
|
2021-10-13 05:09:16 +00:00
|
|
|
|
2020-01-20 16:10:51 +00:00
|
|
|
) -> None:
|
2021-11-20 18:01:22 +00:00
|
|
|
'''
|
2024-02-20 18:12:51 +00:00
|
|
|
Cancel actor gracefully once its "main" portal's
|
2020-01-20 16:10:51 +00:00
|
|
|
result arrives.
|
|
|
|
|
|
2024-02-20 18:12:51 +00:00
|
|
|
Should only be called for actors spawned via the
|
|
|
|
|
`Portal.run_in_actor()` API.
|
|
|
|
|
|
|
|
|
|
=> and really this API will be deprecated and should be
|
|
|
|
|
re-implemented as a `.hilevel.one_shot_task_nursery()`..)
|
2021-04-29 02:11:59 +00:00
|
|
|
|
2021-11-20 18:01:22 +00:00
|
|
|
'''
|
2021-10-13 05:09:16 +00:00
|
|
|
# if this call errors we store the exception for later
|
|
|
|
|
# in ``errors`` which will be reraised inside
|
2022-10-09 17:12:50 +00:00
|
|
|
# an exception group and we still send out a cancel request
|
2024-05-09 19:20:03 +00:00
|
|
|
result: Any|Exception = await exhaust_portal(
|
|
|
|
|
portal,
|
|
|
|
|
actor,
|
|
|
|
|
)
|
2021-10-13 05:09:16 +00:00
|
|
|
if isinstance(result, Exception):
|
Use `.aid.uid` to avoid deprecation warns
I started getting annoyed by all the warnings from `pytest` during work
on macos suport in CI, so this replaces all `Actor.uid`/`Channel.uid`
accesses with `.aid.uid` (or `.aid.reprol()` for log msgs) across the
core runtime and IPC subsystems to avoid the noise.
This also provides incentive to start the adjustment to all
`.uid`-holding/tracking internal `dict`-tables/data-structures to
instead use `.msg.types.Aid`. Hopefully that will come a (vibed?) follow
up shortly B)
Deats,
- `._context`: swap all `self._actor.uid`, `self.chan.uid`,
and `portal.actor.uid` refs to `.aid.uid`; use
`.aid.reprol()` for log/error formatting.
- `._rpc`: same treatment for `actor.uid`, `chan.uid` in
log msgs and cancel-scope handling; fix `str(err)` typo
in `ContextCancelled` log.
- `._runtime`: update `chan.uid` -> `chan.aid.uid` in ctx
cache lookups, RPC `Start` msg, registration and
cancel-request handling; improve ctxc log formatting.
- `._spawn`: replace all `subactor.uid` with
`.aid.uid` for child-proc tracking, IPC peer waiting,
debug-lock acquisition, and nursery child dict ops.
- `._supervise`: same for `subactor.uid` in cancel and
portal-wait paths; use `actor.aid.uid` for error dict.
- `._state`: fix `last.uid` -> `last.aid.uid` in
`current_actor()` error msg.
Also,
- `._chan`: make `Channel.aid` a proper `@property` backed
by `._aid` so we can add validation/typing later.
- `.log`: use `current_actor().aid.uuid` instead of
`.uid[1]` for actor-uid log field.
- `.msg.types`: add TODO comment for `Start.aid` field
conversion.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-08 19:27:48 +00:00
|
|
|
errors[actor.aid.uid]: Exception = result
|
2024-03-01 15:47:42 +00:00
|
|
|
log.cancel(
|
|
|
|
|
'Cancelling subactor runtime due to error:\n\n'
|
Use `.aid.uid` to avoid deprecation warns
I started getting annoyed by all the warnings from `pytest` during work
on macos suport in CI, so this replaces all `Actor.uid`/`Channel.uid`
accesses with `.aid.uid` (or `.aid.reprol()` for log msgs) across the
core runtime and IPC subsystems to avoid the noise.
This also provides incentive to start the adjustment to all
`.uid`-holding/tracking internal `dict`-tables/data-structures to
instead use `.msg.types.Aid`. Hopefully that will come a (vibed?) follow
up shortly B)
Deats,
- `._context`: swap all `self._actor.uid`, `self.chan.uid`,
and `portal.actor.uid` refs to `.aid.uid`; use
`.aid.reprol()` for log/error formatting.
- `._rpc`: same treatment for `actor.uid`, `chan.uid` in
log msgs and cancel-scope handling; fix `str(err)` typo
in `ContextCancelled` log.
- `._runtime`: update `chan.uid` -> `chan.aid.uid` in ctx
cache lookups, RPC `Start` msg, registration and
cancel-request handling; improve ctxc log formatting.
- `._spawn`: replace all `subactor.uid` with
`.aid.uid` for child-proc tracking, IPC peer waiting,
debug-lock acquisition, and nursery child dict ops.
- `._supervise`: same for `subactor.uid` in cancel and
portal-wait paths; use `actor.aid.uid` for error dict.
- `._state`: fix `last.uid` -> `last.aid.uid` in
`current_actor()` error msg.
Also,
- `._chan`: make `Channel.aid` a proper `@property` backed
by `._aid` so we can add validation/typing later.
- `.log`: use `current_actor().aid.uuid` instead of
`.uid[1]` for actor-uid log field.
- `.msg.types`: add TODO comment for `Start.aid` field
conversion.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-08 19:27:48 +00:00
|
|
|
f'Portal.cancel_actor() => {portal.channel.aid}\n\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
f'error: {result}\n'
|
2021-10-13 05:09:16 +00:00
|
|
|
)
|
2021-04-29 02:11:59 +00:00
|
|
|
|
2021-10-13 05:09:16 +00:00
|
|
|
else:
|
|
|
|
|
log.runtime(
|
2024-03-01 15:47:42 +00:00
|
|
|
'Cancelling subactor gracefully:\n\n'
|
Use `.aid.uid` to avoid deprecation warns
I started getting annoyed by all the warnings from `pytest` during work
on macos suport in CI, so this replaces all `Actor.uid`/`Channel.uid`
accesses with `.aid.uid` (or `.aid.reprol()` for log msgs) across the
core runtime and IPC subsystems to avoid the noise.
This also provides incentive to start the adjustment to all
`.uid`-holding/tracking internal `dict`-tables/data-structures to
instead use `.msg.types.Aid`. Hopefully that will come a (vibed?) follow
up shortly B)
Deats,
- `._context`: swap all `self._actor.uid`, `self.chan.uid`,
and `portal.actor.uid` refs to `.aid.uid`; use
`.aid.reprol()` for log/error formatting.
- `._rpc`: same treatment for `actor.uid`, `chan.uid` in
log msgs and cancel-scope handling; fix `str(err)` typo
in `ContextCancelled` log.
- `._runtime`: update `chan.uid` -> `chan.aid.uid` in ctx
cache lookups, RPC `Start` msg, registration and
cancel-request handling; improve ctxc log formatting.
- `._spawn`: replace all `subactor.uid` with
`.aid.uid` for child-proc tracking, IPC peer waiting,
debug-lock acquisition, and nursery child dict ops.
- `._supervise`: same for `subactor.uid` in cancel and
portal-wait paths; use `actor.aid.uid` for error dict.
- `._state`: fix `last.uid` -> `last.aid.uid` in
`current_actor()` error msg.
Also,
- `._chan`: make `Channel.aid` a proper `@property` backed
by `._aid` so we can add validation/typing later.
- `.log`: use `current_actor().aid.uuid` instead of
`.uid[1]` for actor-uid log field.
- `.msg.types`: add TODO comment for `Start.aid` field
conversion.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-08 19:27:48 +00:00
|
|
|
f'Portal.cancel_actor() => {portal.channel.aid}\n\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
f'result: {result}\n'
|
|
|
|
|
)
|
2020-01-20 16:10:51 +00:00
|
|
|
|
2021-10-13 05:09:16 +00:00
|
|
|
# cancel the process now that we have a final result
|
|
|
|
|
await portal.cancel_actor()
|
2020-01-20 16:10:51 +00:00
|
|
|
|
|
|
|
|
|
2024-03-01 15:47:42 +00:00
|
|
|
async def hard_kill(
|
2021-06-26 00:52:08 +00:00
|
|
|
proc: trio.Process,
|
2023-05-14 23:31:50 +00:00
|
|
|
|
2024-06-27 20:25:46 +00:00
|
|
|
terminate_after: int = 1.6,
|
2023-10-18 19:29:43 +00:00
|
|
|
# NOTE: for mucking with `.pause()`-ing inside the runtime
|
2023-10-18 19:35:35 +00:00
|
|
|
# whilst also hacking on it XD
|
|
|
|
|
# terminate_after: int = 99999,
|
|
|
|
|
|
2026-05-04 14:51:01 +00:00
|
|
|
*,
|
|
|
|
|
# Subactor's bind addresses + subactor record, used
|
|
|
|
|
# for post-SIGKILL UDS sockpath cleanup. Optional for
|
|
|
|
|
# legacy callers; new call sites should pass at least
|
|
|
|
|
# `subactor` (which lets us reconstruct the sock path
|
|
|
|
|
# from `aid.name + proc.pid` when `bind_addrs` is
|
|
|
|
|
# empty/self-assigned). See `._reap.unlink_uds_bind_addrs()`.
|
|
|
|
|
bind_addrs: list[UnwrappedAddress] | None = None,
|
|
|
|
|
subactor: Actor | None = None,
|
|
|
|
|
|
2021-06-26 00:52:08 +00:00
|
|
|
) -> None:
|
2023-12-11 23:17:42 +00:00
|
|
|
'''
|
|
|
|
|
Un-gracefully terminate an OS level `trio.Process` after timeout.
|
|
|
|
|
|
|
|
|
|
Used in 2 main cases:
|
|
|
|
|
|
|
|
|
|
- "unknown remote runtime state": a hanging/stalled actor that
|
|
|
|
|
isn't responding after sending a (graceful) runtime cancel
|
|
|
|
|
request via an IPC msg.
|
|
|
|
|
- "cancelled during spawn": a process who's actor runtime was
|
|
|
|
|
cancelled before full startup completed (such that
|
|
|
|
|
cancel-request-handling machinery was never fully
|
|
|
|
|
initialized) and thus a "cancel request msg" is never going
|
|
|
|
|
to be handled.
|
|
|
|
|
|
|
|
|
|
'''
|
2024-02-20 18:12:51 +00:00
|
|
|
log.cancel(
|
2024-07-02 20:31:58 +00:00
|
|
|
'Terminating sub-proc\n'
|
|
|
|
|
f'>x)\n'
|
|
|
|
|
f' |_{proc}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
)
|
2021-06-26 00:52:08 +00:00
|
|
|
# NOTE: this timeout used to do nothing since we were shielding
|
|
|
|
|
# the ``.wait()`` inside ``new_proc()`` which will pretty much
|
|
|
|
|
# never release until the process exits, now it acts as
|
|
|
|
|
# a hard-kill time ultimatum.
|
2021-10-14 03:33:31 +00:00
|
|
|
with trio.move_on_after(terminate_after) as cs:
|
2023-05-14 23:31:50 +00:00
|
|
|
|
|
|
|
|
# NOTE: code below was copied verbatim from the now deprecated
|
|
|
|
|
# (in 0.20.0) ``trio._subrocess.Process.aclose()``, orig doc
|
|
|
|
|
# string:
|
|
|
|
|
#
|
|
|
|
|
# Close any pipes we have to the process (both input and output)
|
|
|
|
|
# and wait for it to exit. If cancelled, kills the process and
|
|
|
|
|
# waits for it to finish exiting before propagating the
|
|
|
|
|
# cancellation.
|
2023-12-11 23:17:42 +00:00
|
|
|
#
|
|
|
|
|
# This code was originally triggred by ``proc.__aexit__()``
|
|
|
|
|
# but now must be called manually.
|
2023-05-14 23:31:50 +00:00
|
|
|
with trio.CancelScope(shield=True):
|
|
|
|
|
if proc.stdin is not None:
|
|
|
|
|
await proc.stdin.aclose()
|
|
|
|
|
if proc.stdout is not None:
|
|
|
|
|
await proc.stdout.aclose()
|
|
|
|
|
if proc.stderr is not None:
|
|
|
|
|
await proc.stderr.aclose()
|
|
|
|
|
try:
|
|
|
|
|
await proc.wait()
|
|
|
|
|
finally:
|
|
|
|
|
if proc.returncode is None:
|
|
|
|
|
proc.kill()
|
|
|
|
|
with trio.CancelScope(shield=True):
|
|
|
|
|
await proc.wait()
|
2021-06-26 00:52:08 +00:00
|
|
|
|
2023-12-11 23:17:42 +00:00
|
|
|
# XXX NOTE XXX: zombie squad dispatch:
|
|
|
|
|
# (should ideally never, but) If we do get here it means
|
|
|
|
|
# graceful termination of a process failed and we need to
|
|
|
|
|
# resort to OS level signalling to interrupt and cancel the
|
|
|
|
|
# (presumably stalled or hung) actor. Since we never allow
|
|
|
|
|
# zombies (as a feature) we ask the OS to do send in the
|
|
|
|
|
# removal swad as the last resort.
|
2021-06-26 00:52:08 +00:00
|
|
|
if cs.cancelled_caught:
|
2025-08-15 15:50:17 +00:00
|
|
|
|
|
|
|
|
# TODO? attempt at intermediary-rent-sub
|
|
|
|
|
# with child in debug lock?
|
|
|
|
|
# |_https://github.com/goodboy/tractor/issues/320
|
|
|
|
|
#
|
|
|
|
|
# if not is_root_process():
|
|
|
|
|
# log.warning(
|
|
|
|
|
# 'Attempting to acquire debug-REPL-lock before zombie reap!'
|
|
|
|
|
# )
|
|
|
|
|
# with trio.CancelScope(shield=True):
|
|
|
|
|
# async with debug.acquire_debug_lock(
|
Use `.aid.uid` to avoid deprecation warns
I started getting annoyed by all the warnings from `pytest` during work
on macos suport in CI, so this replaces all `Actor.uid`/`Channel.uid`
accesses with `.aid.uid` (or `.aid.reprol()` for log msgs) across the
core runtime and IPC subsystems to avoid the noise.
This also provides incentive to start the adjustment to all
`.uid`-holding/tracking internal `dict`-tables/data-structures to
instead use `.msg.types.Aid`. Hopefully that will come a (vibed?) follow
up shortly B)
Deats,
- `._context`: swap all `self._actor.uid`, `self.chan.uid`,
and `portal.actor.uid` refs to `.aid.uid`; use
`.aid.reprol()` for log/error formatting.
- `._rpc`: same treatment for `actor.uid`, `chan.uid` in
log msgs and cancel-scope handling; fix `str(err)` typo
in `ContextCancelled` log.
- `._runtime`: update `chan.uid` -> `chan.aid.uid` in ctx
cache lookups, RPC `Start` msg, registration and
cancel-request handling; improve ctxc log formatting.
- `._spawn`: replace all `subactor.uid` with
`.aid.uid` for child-proc tracking, IPC peer waiting,
debug-lock acquisition, and nursery child dict ops.
- `._supervise`: same for `subactor.uid` in cancel and
portal-wait paths; use `actor.aid.uid` for error dict.
- `._state`: fix `last.uid` -> `last.aid.uid` in
`current_actor()` error msg.
Also,
- `._chan`: make `Channel.aid` a proper `@property` backed
by `._aid` so we can add validation/typing later.
- `.log`: use `current_actor().aid.uuid` instead of
`.uid[1]` for actor-uid log field.
- `.msg.types`: add TODO comment for `Start.aid` field
conversion.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-08 19:27:48 +00:00
|
|
|
# subactor_uid=current_actor().aid.uid,
|
2025-08-15 15:50:17 +00:00
|
|
|
# ) as _ctx:
|
|
|
|
|
# log.warning(
|
|
|
|
|
# 'Acquired debug lock, child ready to be killed ??\n'
|
|
|
|
|
# )
|
|
|
|
|
|
2024-03-13 13:55:47 +00:00
|
|
|
# TODO: toss in the skynet-logo face as ascii art?
|
2024-02-20 18:12:51 +00:00
|
|
|
log.critical(
|
2024-03-13 13:55:47 +00:00
|
|
|
# 'Well, the #ZOMBIE_LORD_IS_HERE# to collect\n'
|
|
|
|
|
'#T-800 deployed to collect zombie B0\n'
|
2024-07-02 20:31:58 +00:00
|
|
|
f'>x)\n'
|
|
|
|
|
f' |_{proc}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
)
|
2021-06-26 00:52:08 +00:00
|
|
|
proc.kill()
|
|
|
|
|
|
2026-05-04 14:51:01 +00:00
|
|
|
# Post-mortem UDS sockpath cleanup. SIGKILL bypassed
|
|
|
|
|
# the subactor's normal `os.unlink(addr.sockpath)` in
|
|
|
|
|
# `_serve_ipc_eps`'s `finally:`; the parent has the
|
|
|
|
|
# bind addrs (or can reconstruct from name + pid) so
|
|
|
|
|
# we do it here. Runs UNCONDITIONALLY (graceful-exit
|
|
|
|
|
# case is a no-op via `FileNotFoundError` skip in the
|
|
|
|
|
# helper) so the cleanup also covers the "cancelled
|
|
|
|
|
# during spawn" path where the subactor never reached
|
|
|
|
|
# its IPC server finally block.
|
|
|
|
|
unlink_uds_bind_addrs(
|
|
|
|
|
proc,
|
|
|
|
|
bind_addrs=bind_addrs,
|
|
|
|
|
subactor=subactor,
|
|
|
|
|
)
|
|
|
|
|
|
2021-06-26 00:52:08 +00:00
|
|
|
|
2024-03-01 15:47:42 +00:00
|
|
|
async def soft_kill(
|
2021-12-02 17:34:27 +00:00
|
|
|
proc: ProcessType,
|
2021-12-02 03:41:10 +00:00
|
|
|
wait_func: Callable[
|
2021-12-02 17:34:27 +00:00
|
|
|
[ProcessType],
|
|
|
|
|
Awaitable,
|
2021-12-02 03:41:10 +00:00
|
|
|
],
|
|
|
|
|
portal: Portal,
|
|
|
|
|
|
|
|
|
|
) -> None:
|
2023-12-11 23:17:42 +00:00
|
|
|
'''
|
2024-03-01 15:47:42 +00:00
|
|
|
Wait for proc termination but **don't yet** teardown
|
|
|
|
|
std-streams since it will clobber any ongoing pdb REPL
|
|
|
|
|
session.
|
|
|
|
|
|
|
|
|
|
This is our "soft"/graceful, and thus itself also cancellable,
|
|
|
|
|
join/reap on an actor-runtime-in-process shutdown; it is
|
|
|
|
|
**not** the same as a "hard kill" via an OS signal (for that
|
|
|
|
|
see `.hard_kill()`).
|
2023-12-11 23:17:42 +00:00
|
|
|
|
|
|
|
|
'''
|
2025-07-07 23:11:01 +00:00
|
|
|
chan: Channel = portal.channel
|
|
|
|
|
peer_aid: msgtypes.Aid = chan.aid
|
2021-12-02 03:41:10 +00:00
|
|
|
try:
|
2024-02-20 18:12:51 +00:00
|
|
|
log.cancel(
|
2025-02-26 18:16:15 +00:00
|
|
|
f'Soft killing sub-actor via portal request\n'
|
|
|
|
|
f'\n'
|
2025-07-07 23:11:01 +00:00
|
|
|
f'c)=> {peer_aid.reprol()}@[{chan.maddr}]\n'
|
|
|
|
|
f' |_{proc}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
)
|
|
|
|
|
# wait on sub-proc to signal termination
|
2021-12-02 03:41:10 +00:00
|
|
|
await wait_func(proc)
|
2024-02-20 18:12:51 +00:00
|
|
|
|
2021-12-02 03:41:10 +00:00
|
|
|
except trio.Cancelled:
|
2024-05-22 19:21:01 +00:00
|
|
|
with trio.CancelScope(shield=True):
|
2025-07-07 23:11:01 +00:00
|
|
|
await debug.maybe_wait_for_debugger(
|
2024-05-22 19:21:01 +00:00
|
|
|
child_in_debug=_runtime_vars.get(
|
|
|
|
|
'_debug_mode', False
|
|
|
|
|
),
|
|
|
|
|
header_msg=(
|
|
|
|
|
'Delaying `soft_kill()` subproc reaper while debugger locked..\n'
|
|
|
|
|
),
|
|
|
|
|
# TODO: need a diff value then default?
|
|
|
|
|
# poll_steps=9999999,
|
|
|
|
|
)
|
|
|
|
|
|
2021-12-02 03:41:10 +00:00
|
|
|
# if cancelled during a soft wait, cancel the child
|
|
|
|
|
# actor before entering the hard reap sequence
|
|
|
|
|
# below. This means we try to do a graceful teardown
|
|
|
|
|
# via sending a cancel message before getting out
|
|
|
|
|
# zombie killing tools.
|
2021-12-22 19:00:34 +00:00
|
|
|
async with trio.open_nursery() as n:
|
|
|
|
|
n.cancel_scope.shield = True
|
|
|
|
|
|
|
|
|
|
async def cancel_on_proc_deth():
|
|
|
|
|
'''
|
2024-03-01 15:47:42 +00:00
|
|
|
"Cancel-the-cancel" request: if we detect that the
|
|
|
|
|
underlying sub-process exited prior to
|
|
|
|
|
a `Portal.cancel_actor()` call completing .
|
2021-12-22 19:00:34 +00:00
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
await wait_func(proc)
|
|
|
|
|
n.cancel_scope.cancel()
|
|
|
|
|
|
2023-12-11 23:17:42 +00:00
|
|
|
# start a task to wait on the termination of the
|
|
|
|
|
# process by itself waiting on a (caller provided) wait
|
|
|
|
|
# function which should unblock when the target process
|
|
|
|
|
# has terminated.
|
2021-12-22 19:00:34 +00:00
|
|
|
n.start_soon(cancel_on_proc_deth)
|
2023-12-11 23:17:42 +00:00
|
|
|
|
|
|
|
|
# send the actor-runtime a cancel request.
|
2021-12-02 03:41:10 +00:00
|
|
|
await portal.cancel_actor()
|
2021-12-22 19:00:34 +00:00
|
|
|
|
2021-12-22 19:53:36 +00:00
|
|
|
if proc.poll() is None: # type: ignore
|
2021-12-22 19:00:34 +00:00
|
|
|
log.warning(
|
2024-02-20 18:12:51 +00:00
|
|
|
'Subactor still alive after cancel request?\n\n'
|
2025-04-03 17:19:19 +00:00
|
|
|
f'uid: {peer_aid}\n'
|
2024-02-20 18:12:51 +00:00
|
|
|
f'|_{proc}\n'
|
2023-01-28 22:37:57 +00:00
|
|
|
)
|
2021-12-22 19:00:34 +00:00
|
|
|
n.cancel_scope.cancel()
|
2021-12-02 03:41:10 +00:00
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
2019-11-26 14:23:37 +00:00
|
|
|
async def new_proc(
|
2022-10-09 20:05:40 +00:00
|
|
|
name: str,
|
|
|
|
|
actor_nursery: ActorNursery,
|
|
|
|
|
subactor: Actor,
|
|
|
|
|
errors: dict[tuple[str, str], Exception],
|
|
|
|
|
|
|
|
|
|
# passed through to actor main
|
2025-03-31 01:21:10 +00:00
|
|
|
bind_addrs: list[UnwrappedAddress],
|
|
|
|
|
parent_addr: UnwrappedAddress,
|
2022-10-09 20:05:40 +00:00
|
|
|
_runtime_vars: dict[str, Any], # serialized and sent to _child
|
|
|
|
|
|
|
|
|
|
*,
|
|
|
|
|
|
|
|
|
|
infect_asyncio: bool = False,
|
2025-03-12 19:13:40 +00:00
|
|
|
task_status: TaskStatus[Portal] = trio.TASK_STATUS_IGNORED,
|
|
|
|
|
proc_kwargs: dict[str, any] = {}
|
2022-10-09 20:05:40 +00:00
|
|
|
|
|
|
|
|
) -> None:
|
|
|
|
|
|
|
|
|
|
# lookup backend spawning target
|
2024-02-20 18:12:51 +00:00
|
|
|
target: Callable = _methods[_spawn_method]
|
2022-10-09 20:05:40 +00:00
|
|
|
|
|
|
|
|
# mark the new actor with the global spawn method
|
|
|
|
|
subactor._spawn_method = _spawn_method
|
|
|
|
|
|
|
|
|
|
await target(
|
|
|
|
|
name,
|
|
|
|
|
actor_nursery,
|
|
|
|
|
subactor,
|
|
|
|
|
errors,
|
2023-09-27 19:19:30 +00:00
|
|
|
bind_addrs,
|
2022-10-09 20:05:40 +00:00
|
|
|
parent_addr,
|
|
|
|
|
_runtime_vars, # run time vars
|
|
|
|
|
infect_asyncio=infect_asyncio,
|
|
|
|
|
task_status=task_status,
|
2025-03-12 19:13:40 +00:00
|
|
|
proc_kwargs=proc_kwargs
|
2022-10-09 20:05:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
Mv `trio_proc`/`mp_proc` to per-backend submods
Split the monolithic `spawn._spawn` into a slim
"core" + per-backend submodules so a future
`._subint` backend (per issue #379) can drop in
without piling more onto `_spawn.py`.
`._spawn` retains the cross-backend supervisor
machinery: `SpawnMethodKey`, `_methods` registry,
`_spawn_method`/`_ctx` state, `try_set_start_method()`,
the `new_proc()` dispatcher, and the shared helpers
`exhaust_portal()`, `cancel_on_completion()`,
`hard_kill()`, `soft_kill()`, `proc_waiter()`.
Deats,
- mv `trio_proc()` → new `spawn._trio`
- mv `mp_proc()` → new `spawn._mp`, reads `_ctx` and
`_spawn_method` via `from . import _spawn` for
late binding bc both get mutated by
`try_set_start_method()`
- `_methods` wires up the new submods via late
bottom-of-module imports to side-step circular
dep (both backend mods pull shared helpers from
`._spawn`)
- prune now-unused imports from `_spawn.py` — `sys`,
`is_root_process`, `current_actor`,
`is_main_process`, `_mp_main`, `ActorFailure`,
`pretty_struct`, `_pformat`
Also,
- `_testing.pytest.pytest_generate_tests()` now
drives the valid-backend set from
`typing.get_args(SpawnMethodKey)` so adding a
new backend (e.g. `'subint'`) doesn't require
touching the harness
- refresh `spawn/__init__.py` docstring for the
new layout
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-04-17 05:58:05 +00:00
|
|
|
# NOTE: bottom-of-module to avoid a circular import since the
|
|
|
|
|
# backend submodules pull `cancel_on_completion`/`soft_kill`/
|
|
|
|
|
# `hard_kill`/`proc_waiter` from this module.
|
|
|
|
|
from ._trio import trio_proc
|
|
|
|
|
from ._mp import mp_proc
|
2022-10-09 20:05:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# proc spawning backend target map
|
2022-10-09 21:54:55 +00:00
|
|
|
_methods: dict[SpawnMethodKey, Callable] = {
|
2022-10-09 20:05:40 +00:00
|
|
|
'trio': trio_proc,
|
2022-10-09 21:54:55 +00:00
|
|
|
'mp_spawn': mp_proc,
|
|
|
|
|
'mp_forkserver': mp_proc,
|
2022-10-09 20:05:40 +00:00
|
|
|
}
|