Handle "out-of-layer" remote `Context` cancellation
Such that if the local task hasn't resolved but is `trio.Cancelled` and a `.canceller` was set, we report a `'actor-cancelled'` from `.repr_state: str`. Bit of formatting to avoid needless newlines too!final_eg_refinements
parent
5ccb36af57
commit
967d0e4836
|
@ -1011,7 +1011,6 @@ class Context:
|
|||
else:
|
||||
log.cancel(
|
||||
f'Timed out on cancel request of remote task?\n'
|
||||
f'\n'
|
||||
f'{reminfo}'
|
||||
)
|
||||
|
||||
|
@ -1492,6 +1491,12 @@ class Context:
|
|||
):
|
||||
status = 'peer-cancelled'
|
||||
|
||||
case (
|
||||
Unresolved,
|
||||
trio.Cancelled(), # any error-type
|
||||
) if self.canceller:
|
||||
status = 'actor-cancelled'
|
||||
|
||||
# (remote) error condition
|
||||
case (
|
||||
Unresolved,
|
||||
|
@ -2273,7 +2278,7 @@ async def open_context_from_portal(
|
|||
logmeth = log.exception
|
||||
|
||||
logmeth(
|
||||
f'ctx {ctx.side!r}-side exited with {ctx.repr_outcome()}\n'
|
||||
f'ctx {ctx.side!r}-side exited with {ctx.repr_outcome()!r}\n'
|
||||
)
|
||||
|
||||
if debug_mode():
|
||||
|
|
Loading…
Reference in New Issue