From 60fc43e530aed4eb4dc932f140518df62461d2fd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 20 May 2024 16:11:59 -0400 Subject: [PATCH] Shield channel closing in `_connect_chan()` --- tractor/_ipc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tractor/_ipc.py b/tractor/_ipc.py index 70774be..511a053 100644 --- a/tractor/_ipc.py +++ b/tractor/_ipc.py @@ -716,4 +716,5 @@ async def _connect_chan( chan = Channel((host, port)) await chan.connect() yield chan - await chan.aclose() + with trio.CancelScope(shield=True): + await chan.aclose()