From ee7959cb55eb527fb2ea2713de1663ae7c1af3d9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 8 Sep 2018 09:40:35 -0400 Subject: [PATCH] Fix same named actor race When an actor has already been registered with the arbiter it should exist in the registry and thus the wait event should have been removed. Check that the registry indeed holds an event before clearing it. --- tractor/_actor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index 2e00e99..4278a0d 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -668,7 +668,8 @@ class Arbiter(Actor): events = self._waiters.pop(name, ()) self._waiters.setdefault(name, []).append(uid) for event in events: - event.set() + if isinstance(event, trio.Event): + event.set() def unregister_actor(self, uid: Tuple[str, str]) -> None: self._registry.pop(uid, None)