You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serial manager: add last-detach grace window before physical port close #632
SharedSerialManager already enforces one daemon-owned SerialSession per port and fans serial output out through a broadcast channel, but both WebSocket and HTTP monitor cleanup physically close the OS serial handle as soon as the last reader/writer detaches.
That still preserves the close/reopen thrash described in #592: a client that logically closes and reconnects immediately can force a physical close/open cycle on the USB CDC port.
Scope
Add a daemon-side grace window for last-detach cleanup:
logical detach removes the subscriber immediately;
if the port has no readers/writer, schedule physical close after a short grace window (default 2s);
a new attach/open during the grace window cancels or invalidates the pending close and reuses the existing OS handle;
deploy preemption remains immediate and force-closes the port;
status/locks should still show an open session during the grace period so stale sessions are visible.
Acceptance
Unit tests cover pending close cancellation/reuse and delayed close execution.
WebSocket and HTTP monitor cleanup paths use the graceful last-detach helper instead of direct close_port.
Activity
fix(serial): delay physical close after last detach (#633)