Repository navigation
fix(stalls): a starved disk no longer freezes main or the window (core 0.40.8) - #228
Merged
Merged
Conversation
…e 0.40.8) Owner, 2026-10-15: "heavy stalls ... up to 5-10 seconds". MEASURED in Stable's diag log, 11:48:49 to 11:53:45: the disk was starved machine-wide (the fs canary 1 to 7 s in Stable and Prism alike; Prism's bundled search indexer crawling C:), and Stable's main stalled 3 to 6 s with no IPC around it while Prism's barely did. Main wrote tabs.json (every ~400 ms while agents work) and the window state with writeFileSync, and a Ctrl+V asked main for the clipboard with sendSync, so the page froze 6 to 8 s with main (page stacks in onKey). - createAtomicWriter (core/main/atomicWrite.ts): the debounced saves write their .tmp on the threadpool and rename on main; the close, quit and session end still write synchronously (rule 7). A save never lands over a newer one. - tabsStore and windowState use it. - The paste reads the clipboard through ipc.invoke (readClipboardAsync); the key handler still returns at once. The sync channel stays for a host bridge without the async one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 15, 2026
…e 0.40.8) (#228) Owner, 2026-10-15: "heavy stalls ... up to 5-10 seconds". MEASURED in Stable's diag log, 11:48:49 to 11:53:45: the disk was starved machine-wide (the fs canary 1 to 7 s in Stable and Prism alike; Prism's bundled search indexer crawling C:), and Stable's main stalled 3 to 6 s with no IPC around it while Prism's barely did. Main wrote tabs.json (every ~400 ms while agents work) and the window state with writeFileSync, and a Ctrl+V asked main for the clipboard with sendSync, so the page froze 6 to 8 s with main (page stacks in onKey). - createAtomicWriter (core/main/atomicWrite.ts): the debounced saves write their .tmp on the threadpool and rename on main; the close, quit and session end still write synchronously (rule 7). A save never lands over a newer one. - tabsStore and windowState use it. - The paste reads the clipboard through ipc.invoke (readClipboardAsync); the key handler still returns at once. The sync channel stays for a host bridge without the async one. Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner, 2026-10-15: "gotten some heavy stalls ... up to 5-10 seconds", then "go ahead" on this fix.
Measured in Stable's diag log, 11:48:49 to 11:53:45: the disk was starved machine-wide (the fs canary 1 to 7 s in both Stable and Prism; the cause was Prism's bundled search indexer crawling C: after its service crashed, which the Prism session is fixing). Stable's main stalled 3 to 6 s with no IPC around it, its page 6 to 8.7 s (stacks in
onKey); Prism's main barely stalled.Why Stable froze: main saved
tabs.json(about every 400 ms while agents work) and the window state withwriteFileSync, and a Ctrl+V read the clipboard withsendSync, so the page waited on a blocked main.Changes
createAtomicWriter(core): debounced saves write their.tmpon the threadpool and rename on main. The close, quit and session end still write synchronously (rule 7). A save never lands over a newer one.tabsStoreandwindowStateuse it.ipc.invoke(readClipboardAsync); the key handler still returns at once. The sync channel stays for a host bridge without the async one. Pastes are still sanitised (rule 1).Tests: 4 new unit tests for the writer (async save lands, newest of a burst wins, an older save never lands over the close's, a later save does). Unit 2141 pass. Full e2e: all scenarios passed (a first run had one 45 s prompt timeout that did not repeat).
Core 0.40.7 -> 0.40.8, app 0.52.2 -> 0.52.3. Prism gets the async paste through the core; its own periodic saves could use
createAtomicWritertoo.🤖 Generated with Claude Code
https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA