Skip to content

Commit

Permalink
Tolerate double .remove()s of stream on portal teardowns
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jul 14, 2022
1 parent dd6ee73 commit 1c16de5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tractor/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,14 @@ async def open_stream(

finally:
if self._portal:
self._portal._streams.remove(rchan)
try:
self._portal._streams.remove(stream)
except KeyError:
log.warning(
f'Stream was already destroyed?\n'
f'actor: {self.chan.uid}\n'
f'ctx id: {self.cid}'
)

async def result(self) -> Any:
'''
Expand Down

0 comments on commit 1c16de5

Please sign in to comment.