mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-19 05:54:30 +00:00
The menubar wedged on "Loading Today…" for hours after an idle period. Root cause: DataClient.runCLI called the blocking process.waitUntilExit() from an async function on Swift's cooperative thread pool. On a 16-core machine, 16 concurrent slow `codeburn` subprocesses pinned all 16 cooperative threads inside waitUntilExit; the 45s timeout — itself a Task on that same pool — could then never be scheduled to kill them, so the deadlock was permanent. Confirmed via sample: 16/16 cooperative threads parked in waitUntilExit. PR #412 (AppStore inFlightKeys bookkeeping) was a layer above the OS-thread deadlock and could not fix it. Move both blocking points off the cooperative pool: bridge waitUntilExit through a global (overcommit) queue via a continuation, and drive the timeout from a DispatchSource on a global queue so it fires even when the pool is saturated. Extract runProcess for testability; add a concurrency + timeout smoke test and an output/exit-code test. |
||
|---|---|---|
| .. | ||
| CodeBurnMenubar | ||