Only report disconnected actors if proc is still alive?

sigintsaviour_citesthackin
Tyler Goodlet 2022-07-10 18:05:44 -04:00
parent 8291ee09b3
commit 9e56881163
1 changed files with 17 additions and 14 deletions

View File

@ -610,18 +610,6 @@ class Actor:
if ( if (
local_nursery local_nursery
): ):
if disconnected:
# if the transport died and this actor is still
# registered within a local nursery, we report that the
# IPC layer may have failed unexpectedly since it may be
# the cause of other downstream errors.
entry = local_nursery._children.get(uid)
if entry:
_, proc, _ = entry
log.warning(
f'Actor {uid}@{proc} IPC connection broke!?')
# if proc.poll() is not None:
# log.error('Actor {uid} proc died and IPC broke?')
log.cancel(f"Waiting on cancel request to peer {chan.uid}") log.cancel(f"Waiting on cancel request to peer {chan.uid}")
# XXX: this is a soft wait on the channel (and its # XXX: this is a soft wait on the channel (and its
@ -659,7 +647,22 @@ class Actor:
await local_nursery.exited.wait() await local_nursery.exited.wait()
# if local_nursery._children if disconnected:
# if the transport died and this actor is still
# registered within a local nursery, we report that the
# IPC layer may have failed unexpectedly since it may be
# the cause of other downstream errors.
entry = local_nursery._children.get(uid)
if entry:
_, proc, _ = entry
# if proc.poll() is not None:
# log.error('Actor {uid} proc died and IPC broke?')
if proc.poll() is None:
log.cancel(
f'Actor {uid} IPC terminated but proc is alive?!'
)
# f'Actor {uid}@{proc} IPC connection broke!?'
# ``Channel`` teardown and closure sequence # ``Channel`` teardown and closure sequence
@ -701,7 +704,7 @@ class Actor:
# await chan.aclose() # await chan.aclose()
except trio.BrokenResourceError: except trio.BrokenResourceError:
log.warning(f"Channel for {chan.uid} was already closed") log.runtime(f"Channel {chan.uid} was already closed")
async def _push_result( async def _push_result(
self, self,