Repository navigation
Domain store: skip writes that change nothing, space the rest five seconds apart - #317
Merged
Merged
Conversation
Mpdreamz
force-pushed
the
fix/domain-write-churn
branch
from
November 22, 2026 15:23
39f284f to
bd9cc37
Compare
…at least five seconds apart domain.json is about 3 MB, and Heed rewrote it every few seconds for 30 to 55 minutes while left alone, which macOS flagged three times for excessive disk writes. A change that leaves the domain as it was no longer schedules a write, and writes are spaced minimumInterval (5 s) apart. Quitting still writes at once. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Mpdreamz
force-pushed
the
fix/domain-write-churn
branch
from
November 22, 2026 21:05
7eae38e to
6d26f76
Compare
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
macOS flagged Heed three times (Nov 19 twice, Nov 21) for excessive disk writes:
DomainStore.flush()rewriting the ~3 MBdomain.jsonat 650 KB/s to 1.3 MB/s for 30 to 55 minutes while idle.applyschedules a write only when the domain actually changed.minimumInterval(5 s) apart. A hard crash can lose the last few seconds of the cache;flushAllon quit still writes at once.This caps the rate whatever feeds it. If a timer commits real changes (a changing timestamp, say), the cause is still there; #316's heartbeat logs which change kinds reach the store, so it can be found.
Tests: unchanged apply writes nothing, a real change is written, writes wait out the interval,
flushAllignores it. I broke the unchanged check and the spacing on purpose and each made a test fail. Full suite and lint pass.Separate from #316 (diagnostics), per the correctness/behaviour split.
🤖 Generated with Claude Code