From 2d72a052aabbc5b7fc161e66a4cae4a98f988270 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 8 Dec 2023 17:43:52 -0500 Subject: [PATCH] Woops, make sure non-disti mode still works wen maybe getting `pikerd` XD --- piker/service/_actor_runtime.py | 43 ++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/piker/service/_actor_runtime.py b/piker/service/_actor_runtime.py index e69882da..1d0c2e69 100644 --- a/piker/service/_actor_runtime.py +++ b/piker/service/_actor_runtime.py @@ -282,28 +282,33 @@ async def maybe_open_pikerd( loglevel=loglevel, **kwargs, ) as (actor, addrs), - - # try to attach to any existing (host-local) `pikerd` - tractor.find_actor( - _root_dname, - registry_addrs=registry_addrs, - only_first=True, - # raise_on_none=True, - ) as pikerd_portal, - ): - # connect to any existing remote daemon presuming its - # registry socket was selected. - if pikerd_portal is not None: - - # sanity check that we are actually connecting to - # a remote process and not ourselves. - assert actor.uid != pikerd_portal.channel.uid - assert registry_addrs - - yield pikerd_portal + if _root_dname in actor.uid: + yield None return + # NOTE: IFF running in disti mode, try to attach to any + # existing (host-local) `pikerd`. + else: + async with tractor.find_actor( + _root_dname, + registry_addrs=registry_addrs, + only_first=True, + # raise_on_none=True, + ) as pikerd_portal: + + # connect to any existing remote daemon presuming its + # registry socket was selected. + if pikerd_portal is not None: + + # sanity check that we are actually connecting to + # a remote process and not ourselves. + assert actor.uid != pikerd_portal.channel.uid + assert registry_addrs + + yield pikerd_portal + return + # presume pikerd role since no daemon could be found at # configured address async with open_pikerd(