Skip to content

Commit

Permalink
Don't raise on a broken IPC-context when sending stop msg
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Dec 12, 2022
1 parent 9f0b07c commit c5b4ab6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tractor/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ async def subscribe(
self,

) -> AsyncIterator[BroadcastReceiver]:
'''Allocate and return a ``BroadcastReceiver`` which delegates
'''
Allocate and return a ``BroadcastReceiver`` which delegates
to this message stream.
This allows multiple local tasks to receive each their own copy
Expand Down Expand Up @@ -609,7 +610,14 @@ async def open_stream(
# XXX: Make the stream "one-shot use". On exit, signal
# ``trio.EndOfChannel``/``StopAsyncIteration`` to the
# far end.
await self.send_stop()
try:
await self.send_stop()
except trio.BrokenResourceError:
log.warning(
f"Couldn't close: stream already broken?\n"
f'actor: {self.chan.uid}\n'
f'ctx id: {self.cid}'
)

finally:
if self._portal:
Expand Down

0 comments on commit c5b4ab6

Please sign in to comment.