Repository navigation
fix(cloud): run the link client in its own process group - #22017
Conversation
Refs #11008 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancelling or timing out a Cloud link signalled only the cmux-tui client. A helper that ignores SIGTERM and inherited the link pipes survived, kept stdout open and left the attempt wedged. Spawn the client with POSIX_SPAWN_SETPGROUP, signal the whole group, and kill what is left of the group once the leader exits: at once on cancel or disconnect, after the bounded stderr drain when the client exits on its own. Fixes #11008 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
SIGTERM goes to the client only, so cmux-tui still closes its ssh child with EOF. SSH links no longer sweep their group: OpenSSH's ProxyCommand child of a persisted ControlMaster stays in the group that started it, and killing it would drop every connection sharing the master. The leftover sweep runs beside the actor hop, and a missing or unusable client keeps the Process-style error text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Probably yours: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by
Agents: Merge receipt for
Labeled |
Dogfood tours of
|
|
The red |
|
merge-override: Only red is CMUXCLIErrorOutputRegressionTests.testBareRelativeDirectoryPathOpenBypassesProtectedSocketForExternalCLI (CLI, untouched here). The same test fails on main run 39232003699, job 118001773763 (sharded app-host unit tests 3/7). macOS status and ci-status only roll it up. CmuxCloud swift-package-tests pass; review found no blockers. |
Summary
cmux DEV crashed twice on 2026-10-18 (build 108, 03:58 and 20:46) with
EXC_BREAKPOINTon thecmux-next main-thread watchdogthread: the debug-only 10 s hang assertion inMainThreadWatchdog.checkHang. Both reports haveprocRole: Background. In the 20:46 report the main thread is idle inmach_msginside-[NSApplication run].The assertion only looked at wall-clock time since the last run-loop heartbeat. In a backgrounded, throttled app the main thread can sit runnable but barely scheduled, so the heartbeat stays stale for 10 s while the thread does almost no work. By the time the crash report is captured, the thread has gone back to sleep. Its message says "busy", but it never checked CPU.
The fix: the assertion now also needs the main thread to have used at least half the threshold in CPU time during the stall. The watchdog thread reads that with
thread_infoon the main thread's port, using the readerBusyWatchdogalready had. If the CPU reading fails, wall-clock time decides, as before. The hang report path does not change:logger.faultandonHang/Sentry still fire at 2 s. A main thread blocked on a lock or a synchronous IPC uses no CPU either, so it is now reported but no longer asserted.Testing
MainThreadWatchdogPolicyTestsadds three tests: the assertion policy for idle/throttled stalls vs busy stalls, the nil-CPU fallback, and reading main-thread CPU from another thread while the main thread spins. The tests were committed first in bfcf792. Red locally: the test target does not compile against the base. Green:swift build --target CmuxNextControlTestson cosmic-gray. The full localswift testcannot link because the base has an unrelated red (MarkdownViewerWritableTests.Hostdoes not conform toFilePageHosting), so CI runs the tests.Changelog
none
🤖 Generated with Claude Code