Skip to content

kicad: harden macOS write timeouts, design commit bounds, and socket paths - #1648

Merged
i2cjak merged 1 commit into
mainfrom
fix-1630-kicad-writes
Nov 23, 2026
Merged

i2cjak merged 1 commit into
mainfrom
fix-1630-kicad-writes

Conversation

@i2cjak

@i2cjak i2cjak commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Issue #1630 reported KiCad writes hanging for 300s while reads succeeded on
macOS v0.16.4 (primarily caused by GCD worker threads blocking SIGCHLD before
#1456/#1607 and unbounded snapguard/kipc waits fixed in #1625). This hardens
the remaining write-path edge cases on HEAD:

  • Remove fallback: true from embedded GUI timeout replies (send_gui_raw
    and expired-deadline Msg::Raw) and check BeginCommit timeouts before
    fallback in ipc::run_on, so embedded BeginCommit timeouts reach
    explain_begin_commit_timeout_gui (and other GUI timeouts surface real
    errors instead of bogus file-fallback activity entries).
  • Bound synchronous design_record_note / commit_design calls (30s
    timeout) via a detached task that still finishes telemetry/STEP warm-up and
    posts completion or failure in the thread, while distinguishing task drop
    from timeout.
  • Use git::push (which sets GIT_TERMINAL_PROMPT=0) in canonical::push_upstream.
  • Canonicalize snapshot::repo_lock keys via canonical::same_file (handling
    macOS /var -> /private/var symlinks) and preserve TurnGuard.person when
    recomputing an empty-top guard in snapguard::write_guard_within.
  • Guard headless kicad-cli api-server socket directories against macOS's
    104-byte SUN_LEN limit with a per-UID bp-ks-<uid> fallback and strict
    0o700 / non-symlink / UID ownership checks.

Fixes #1630

…paths

Issue #1630 reported KiCad writes hanging for 300s while reads succeeded on
macOS v0.16.4 (primarily caused by GCD worker threads blocking SIGCHLD before
#1456/#1607 and unbounded snapguard/kipc waits fixed in #1625). This hardens
the remaining write-path edge cases on HEAD:

- Remove `fallback: true` from embedded GUI timeout replies (`send_gui_raw`
  and expired-deadline `Msg::Raw`) and check `BeginCommit` timeouts before
  `fallback` in `ipc::run_on`, so embedded `BeginCommit` timeouts reach
  `explain_begin_commit_timeout_gui` (and other GUI timeouts surface real
  errors instead of bogus file-fallback activity entries).
- Bound synchronous `design_record_note` / `commit_design` calls (`30s`
  timeout) via a detached task that still finishes telemetry/STEP warm-up and
  posts completion or failure in the thread, while distinguishing task drop
  from timeout.
- Use `git::push` (which sets `GIT_TERMINAL_PROMPT=0`) in `canonical::push_upstream`.
- Canonicalize `snapshot::repo_lock` keys via `canonical::same_file` (handling
  macOS `/var` -> `/private/var` symlinks) and preserve `TurnGuard.person` when
  recomputing an empty-`top` guard in `snapguard::write_guard_within`.
- Guard headless `kicad-cli api-server` socket directories against macOS's
  104-byte `SUN_LEN` limit with a per-UID `bp-ks-<uid>` fallback and strict
  `0o700` / non-symlink / UID ownership checks.

Fixes #1630
@i2cjak
i2cjak merged commit 4cb8be8 into main Nov 23, 2026
3 checks passed
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.

macOS: KiCad edits time out while reads work in headless and embedded modes

1 participant