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.multi_program_tests
parent
6b8393a4d6
commit
ee7959cb55
tractor
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue