From 70e4458fb042e110f94e95c4af49994f462cc89b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 26 Jun 2022 13:47:02 -0400 Subject: [PATCH] Add runtime level msg around channel draining --- tractor/_actor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index 348eee4..9b9bf5d 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -611,7 +611,8 @@ class Actor: entry = local_nursery._children.get(uid) if entry: _, proc, _ = entry - log.warning(f'Actor {uid}@{proc} IPC connection broke!?') + log.warning( + f'Actor {uid}@{proc} IPC connection broke!?') # if proc.poll() is not None: # log.error('Actor {uid} proc died and IPC broke?') @@ -630,6 +631,11 @@ class Actor: # Attempt to wait for the far end to close the channel # and bail after timeout (2-generals on closure). assert chan.msgstream + + log.runtime( + f'Draining lingering msgs from stream {chan.msgstream}' + ) + async for msg in chan.msgstream.drain(): # try to deliver any lingering msgs # before we destroy the channel.