Skip to content

Synchronous git on the main-process event loop with no default timeout #88

Closed

Description

@currentbits

electron/worktrees.js:25-33 (gitOut) and :62-97 (gitTry) use execFileSync with no timeout unless the caller opts in. IPC-reachable paths like diff (:510), listFiles (:751), sync info, repo info, and merge all go through these, and electron/ssh.js:91-98 runs them synchronously over SSH too (ConnectTimeout=10 only bounds the connect). One slow filesystem or remote blocks all agent streaming and every window — the exact failure class already documented for prStatus in docs/ISSUES.md ("blocking the event loop including agent streaming"), fixed there but never generalized.

Fix: add a sane default timeout to gitOut/gitTry (callers can still override), and consider moving the hot IPC paths to async spawn. This is the same bug class as the fixed prStatus freeze — worth a general solution, not another one-off.

Found during the 2026-08-16 improvement audit.

Activity

  1. added
    bug
    plan:todo
    on Aug 16, 2026
  2. currentbits commented on Aug 16, 2026

    @currentbits
    OwnerAuthor

    Fixed in 6d8613d (branch coder/synchronous-git-on-the-main-process-even-d0e336).

    One choke point instead of three: electron/ssh.js execCommand now defaults timeout to SYNC_TIMEOUT_MS (15s), and worktrees.js gitOut/gitTry route through it instead of calling execFileSync directly. So diff, listFiles, sync info, repo info, merge and their ssh variants are all bounded, local and remote.

    • Caller timeouts still win — push keeps its explicit 30s.
    • services.gitFetch/gitPull pass 60s; network git is legitimately slower than local.
    • Tests in electron/test/ssh.test.js: default applied local + over ssh, caller override wins, and gitTry inherits it. Mutation-checked (removing the default fails 3).

    Not done: moving the hot IPC paths to async spawn. 15s is a bounded freeze, not no freeze — that's a bigger change than a bound, so it's left open here.

  3. added
    plan:done
    and removed
    plan:todo
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions