diff --git a/tests/conftest.py b/tests/conftest.py index 1fad2255..c7b20531 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -212,7 +212,7 @@ def sig_prog( ''' for i in range(tries): proc.send_signal(sig) - if not proc.poll(): + if proc.poll() is None: print( f'WARNING, proc still alive after,\n' f'canc_timeout={canc_timeout!r}\n' @@ -224,8 +224,7 @@ def sig_prog( else: # TODO: why sometimes does SIGINT not work on teardown? # seems to happen only when trace logging enabled? - if not proc.poll(): - breakpoint() + if proc.poll() is None: print( f'XXX WARNING KILLING PROG WITH SIGINT XXX\n' f'canc_timeout={canc_timeout!r}\n' diff --git a/tractor/discovery/__init__.py b/tractor/discovery/__init__.py index 93c19e62..1ac8415d 100644 --- a/tractor/discovery/__init__.py +++ b/tractor/discovery/__init__.py @@ -18,10 +18,11 @@ Discovery (protocols) API for automatic addressing and location management of (service) actors. -NOTE: to avoid circular imports, this ``__init__`` -does NOT eagerly import submodules. Use direct -module paths like ``tractor.discovery._addr`` or -``tractor.discovery._api`` instead. +NOTE: this ``__init__`` only eagerly imports the +``._multiaddr`` submodule (for public re-exports). +Heavier submodules like ``._addr`` and ``._api`` +are NOT imported here to avoid circular imports; +use direct module paths for those. ''' from ._multiaddr import ( diff --git a/tractor/discovery/_registry.py b/tractor/discovery/_registry.py index dd235753..7cedb391 100644 --- a/tractor/discovery/_registry.py +++ b/tractor/discovery/_registry.py @@ -196,6 +196,8 @@ class Registrar(Actor): and addr_tup in other_addrs ): other_addrs.remove(addr_tup) + if not other_addrs: + del self._registry[other_uid] break # Append to this uid's addr list (avoid duplicates) diff --git a/tractor/runtime/_runtime.py b/tractor/runtime/_runtime.py index 6ff669a7..bee9e20d 100644 --- a/tractor/runtime/_runtime.py +++ b/tractor/runtime/_runtime.py @@ -1567,7 +1567,7 @@ async def async_main( # XXX, either passed in by caller or delivered # in post spawn-spec handshake for subs. if not accept_addrs: - RuntimeError( + raise RuntimeError( f'No tpt bind addresses provided to actor!?\n' f'parent_addr={parent_addr!r}\n' f'accept_addrs={accept_addrs!r}\n' @@ -1926,7 +1926,7 @@ async def async_main( if failed_unreg: teardown_report += ( f'-> Failed to unregister {actor.name} from ' - f'registar @ {addr}\n' + f'registrar @ {addr}\n' ) # Ensure all peers (actors connected to us as clients) are finished