From d492236f3a92ae9e29877310fae9d0b9663e1e88 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 15 Dec 2018 02:19:47 -0500 Subject: [PATCH] Handle broken channels more resiliently on teardown --- tractor/_actor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index 2604fa4..750487a 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -294,8 +294,11 @@ class Actor: # # XXX: is this necessary (GC should do it?) if chan.connected(): log.debug(f"Disconnecting channel {chan}") - await chan.send(None) - await chan.aclose() + try: + await chan.send(None) + await chan.aclose() + except trio.BrokenResourceError: + log.exception(f"Channel for {chan.uid} was already zonked..") async def _push_result(self, actorid, cid: str, msg: dict) -> None: """Push an RPC result to the local consumer's queue.