Skip to content

Exit when serving stops, instead of waiting on the update checker - #25

Merged
org-event merged 2 commits into
mainfrom
fix-shutdown-hang
Nov 6, 2026
Merged

org-event merged 2 commits into
mainfrom
fix-shutdown-hang

Conversation

@org-event

Copy link
Copy Markdown
Owner

What happened

On the Mac mini the client's virtual display went away: CoreGraphics error 1014 while stopping the mirroring, then CGVirtualDisplay was not created. The display pipeline failed and asked the server to quit, as it should.

The server closed port 3389, but the process never exited. A stack sample of the stuck agent showed the main thread in tokio's blocking-pool shutdown, waiting for update::watch, a spawn_blocking task that sleeps for hours. launchd restarts the agent only after the process exits, so RDP stayed down until the process was killed by hand.

Fix

After serve returns, runtime.shutdown_timeout(2 s) replaces the unbounded wait, so the process exits and launchd starts a fresh server.

Testing

  • cargo test: 51 passed; clippy -D warnings clean.
  • Not reproduced end to end: the pipeline failure cannot be triggered on demand. The fix targets the frame the stack sample showed.

🤖 Generated with Claude Code

After the display pipeline failed the server asked itself to quit and
closed the port, but the process never exited: dropping the runtime
waited for the update checker, a blocking task that sleeps for hours. A
stack sample of the stuck agent showed the main thread there. launchd
restarts the agent only once the process is gone, so RDP stayed down
until the process was killed by hand. The runtime now gives background
work two seconds on shutdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@org-event
org-event enabled auto-merge (rebase) November 6, 2026 12:31
…ade to.

It comes through sspi's async-dnssd, and the advisory is about maintenance,
not a vulnerability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@org-event
org-event merged commit 3411955 into main Nov 6, 2026
9 checks passed
@org-event
org-event deleted the fix-shutdown-hang branch November 6, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant