From 8bb5c1bf96af963a2c67798840e1b86ecae16a5b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 29 Sep 2025 13:26:11 -0400 Subject: [PATCH] `ui._remote_ctl`: shield remote rect removals Since under `trio`-cancellation the `.remove()` is a checkpoint and will be masked by a taskc AND we **always want to remove the rect** despite the surrounding teardown conditions. --- piker/ui/_remote_ctl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piker/ui/_remote_ctl.py b/piker/ui/_remote_ctl.py index ccc8d6e9..05e145e7 100644 --- a/piker/ui/_remote_ctl.py +++ b/piker/ui/_remote_ctl.py @@ -15,8 +15,8 @@ # along with this program. If not, see . ''' -Remote control tasks for sending annotations (and maybe more cmds) -to a chart from some other actor. +Remote control tasks for sending annotations (and maybe more cmds) to +a chart from some other actor. ''' from __future__ import annotations @@ -32,6 +32,7 @@ from typing import ( ) import tractor +import trio from tractor import trionics from tractor import ( Portal, @@ -316,7 +317,9 @@ class AnnotCtl(Struct): ) yield aid finally: - await self.remove(aid) + # async ipc send op + with trio.CancelScope(shield=True): + await self.remove(aid) async def redraw( self,