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
|
@ -668,6 +668,7 @@ class Arbiter(Actor):
|
||||||
events = self._waiters.pop(name, ())
|
events = self._waiters.pop(name, ())
|
||||||
self._waiters.setdefault(name, []).append(uid)
|
self._waiters.setdefault(name, []).append(uid)
|
||||||
for event in events:
|
for event in events:
|
||||||
|
if isinstance(event, trio.Event):
|
||||||
event.set()
|
event.set()
|
||||||
|
|
||||||
def unregister_actor(self, uid: Tuple[str, str]) -> None:
|
def unregister_actor(self, uid: Tuple[str, str]) -> None:
|
||||||
|
|
Loading…
Reference in New Issue