From c1501a36d5e97b69d9e7d61ca57e08524b1c82e6 Mon Sep 17 00:00:00 2001 From: goodboy Date: Tue, 18 Aug 2026 13:45:54 -0400 Subject: [PATCH] Fix `TIPC` two-host service example A registrar root does not register itself in its own actor-name registry, so host B could never discover the advertised `host_a`. Boot that service as a child actor under the `TIPC` registrar instead. Import and pass the enabled `echo` callable to `.open_context()`; the prior module-path string could not produce a `NamespacePath`. Review: PR #493 (copilot-pull-request-reviewer[bot],goodboy) https://github.com/goodboy/tractor/pull/493 (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`)) --- examples/multihost/tipc_cluster/host_a_srv.py | 12 +++++++----- examples/multihost/tipc_cluster/host_b_client.py | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/multihost/tipc_cluster/host_a_srv.py b/examples/multihost/tipc_cluster/host_a_srv.py index 7f586166..c7b9f562 100644 --- a/examples/multihost/tipc_cluster/host_a_srv.py +++ b/examples/multihost/tipc_cluster/host_a_srv.py @@ -47,14 +47,16 @@ async def main() -> None: reg: TIPCAddress = TIPCAddress.get_root() print(f'host A publishing {reg}') - async with tractor.open_root_actor( - name='host_a', + async with tractor.open_nursery( enable_transports=['tipc'], registry_addrs=[reg.unwrap()], - enable_modules=[__name__], - ): + ) as an: + await an.start_actor( + 'host_a', + enable_modules=[__name__], + ) print( - 'registrar up — `tipc nametable show` on EITHER host\n' + 'host_a up — `tipc nametable show` on EITHER host\n' 'should now list this service. ctrl-c to stop.' ) await trio.sleep_forever() diff --git a/examples/multihost/tipc_cluster/host_b_client.py b/examples/multihost/tipc_cluster/host_b_client.py index 966445a3..1e5ea7b9 100644 --- a/examples/multihost/tipc_cluster/host_b_client.py +++ b/examples/multihost/tipc_cluster/host_b_client.py @@ -16,6 +16,7 @@ from __future__ import annotations import trio import tractor +from host_a_srv import echo from tractor.ipc._tipc import ( TIPCAddress, is_tipc_available, @@ -41,7 +42,7 @@ async def main() -> None: async with ( ptl.open_context( - 'host_a_srv:echo', + echo, ) as (ctx, _), ctx.open_stream() as stream, ):