forked from goodboy/tractor
1
0
Fork 0

Ensure arbiter sockaddr type before usage

ipc_failure_while_streaming
Tyler Goodlet 2022-12-13 00:23:27 -05:00
parent a4874a3227
commit d27c081a15
1 changed files with 2 additions and 1 deletions

View File

@ -455,7 +455,7 @@ class Actor:
self._mods: dict[str, ModuleType] = {} self._mods: dict[str, ModuleType] = {}
self.loglevel = loglevel self.loglevel = loglevel
self._arb_addr = ( self._arb_addr: tuple[str, int] | None = (
str(arbiter_addr[0]), str(arbiter_addr[0]),
int(arbiter_addr[1]) int(arbiter_addr[1])
) if arbiter_addr else None ) if arbiter_addr else None
@ -1381,6 +1381,7 @@ async def async_main(
and not actor.is_arbiter and not actor.is_arbiter
): ):
failed = False failed = False
assert isinstance(actor._arb_addr, tuple)
with trio.move_on_after(0.5) as cs: with trio.move_on_after(0.5) as cs:
cs.shield = True cs.shield = True
try: try: