Skip to content

Serialize configuration and log updates with bounded file locks - #2

Merged
Water-Run merged 2 commits into
mainfrom
fix/state-locking
Sep 7, 2026
Merged

Serialize configuration and log updates with bounded file locks#2
Water-Run merged 2 commits into
mainfrom
fix/state-locking

Conversation

@Water-Run

@Water-Run Water-Run commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Concurrent get set operations could overwrite updates to different settings, while log append/trim/clean operations could lose or interleave entries. This change locks the full configuration read-modify-write sequence and each log mutation. Bounded retention scans historical entries incrementally and atomically replaces the retained tail.

Key writes, full configuration saves, and reset share the settings lock; Windows readers cooperate with replacement. OS ownership is released on exit, lock contention has a five-second wait budget, and invalid setters release their lock. Persistent empty sidecar files avoid unlink/recreate races. Older binaries and external editors do not participate; two-file reset is not a crash-atomic database transaction.

Adds seven small worker regressions and shared-desktop resource constraints in AGENTS.md. The existing POSIX executor test now checks actual child-process interval overlap and stable result order, replacing a fixed 750 ms cutoff that failed on macOS at 773 ms.

Validation on final commit 29308e8b55d570248fbe8e8a1e175a807b7f6554:

Native target Nim tests passed CLI Offline matrix
Linux x64 144 37 passed 172 passed, 0 failed, 126 intentional skips
Windows x64 134 35 passed, 2 POSIX-only skips 172 passed, 0 failed, 113 intentional skips
macOS arm64 144 37 passed Not part of this workflow

All native gates passed, including HTTPS and installer checks. Independent Windows CI also passed. Local focused checks passed: 7 state-lock regressions, 2 existing persistence tests, and the executor interval regression; Windows/macOS target checks passed. Local compilation used one low-priority compiler with --parallelBuild:1 and a 2 GiB per-process address-space cap.

@Water-Run
Water-Run marked this pull request as ready for review September 7, 2026 04:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T04:35:44.874456Z 29308e8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Water-Run
Water-Run merged commit fc3fb48 into main Sep 7, 2026
5 checks passed
@Water-Run
Water-Run deleted the fix/state-locking branch September 7, 2026 08:30
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