Skip to content

[Bug]: Opening a non-git folder as a worktree deadlocks the entire headless serve runtime (all clients lose RPC) #5308

Closed

Description

@mochimochi-brian

Operating system

Linux

Orca version

1.4.56

Details

Operating system: Linux (CentOS 7, headless orca-ide serve via Xvfb, --no-sandbox --disable-gpu)
Orca version: 1.4.56
Setup: headless runtime started with orca-ide serve --pairing-address <host> --json, reached over an SSH tunnel by a desktop client and an iOS mobile client.

Summary

Opening a non-git folder as a worktree and starting an agent (Claude) in its terminal deadlocks the entire serve runtime, not just one tab. After it happens, every client (mobile, desktop, and the local orca-ide CLI) can still connect but gets zero response to any RPC — workspaces won't load and keyboard input does nothing. This looks related to #4436, but there the UI freezes while the backend keeps answering the CLI; here the backend (serve) itself stops answering all clients.

What happened

  1. Opened my home directory /home5/Brian (a non-git folder) as a worktree via "open folder".
  2. Started Claude in that worktree's terminal.
  3. Some time later, all RPCs stopped resolving. A connected mobile client could switch to the environment but showed no workspaces and accepted no input.

Reproduced twice on the same machine. The second time it recurred only ~12 minutes after a clean restart, so it is trigger-driven, not uptime-driven.

Evidence that this is an app-level deadlock (not a process freeze / resource exhaustion)

I ruled out several causes before concluding it's an internal hang in the request handlers:

  • Not an OS process stop (SIGTSTP/T state): all orca-ide processes were STAT=S, actively running.
  • Event loop is alive: strace -p <electron-pid> -c over 3s showed the main thread cycling normally through poll/epoll_pwait (92% in poll). It is not blocked in a syscall.
  • Requests are being read, never answered: while a request hung, the socket was ESTABLISHED with Recv-Q 0 — the data was consumed by the app. Even a static asset (GET /web-index.html) returned 0 bytes and timed out.
  • Not fd exhaustion: 120 / 4096 open fds.
  • Not accept-backlog saturation: Recv-Q 0, no backlog buildup.
  • Not an NFS stall: no D-state processes; /home5 (NFS) read/write was fine.

So the HTTP/WS handlers appear to be stuck on a never-resolving promise, which is why a client can open a WS connection but no RPC ever returns.

The trigger and a recurrence loop

Both times, the last line written to serve.log before the freeze was the pty:history line for the non-git home-directory worktree:

[pty:history] worktreeId=<uuid>::/home5/Brian shell=bash histFile=/home5/Brian/.config/orca/terminal-history/<id>/bash_history

There's also a self-reinforcing loop: that worktree was persisted in ~/.config/orca/orca-data.json under workspaceSession.activeWorktreeIdsOnShutdown (plus worktreeMeta, tabsByWorktree, tabGroups, etc.). On the next client reconnect the PTY tab auto-restored and the runtime re-hung immediately, so restarting serve alone did not fix it.

Workaround / recovery

Restarting serve is not enough on its own. What worked:

  1. Stop serve.
  2. Remove the offending worktree's entries from ~/.config/orca/orca-data.json (in my case 11 entries across repos, worktreeMeta, and the workspaceSession.* maps). Keep a backup.
  3. Restart serve.

After that the worktree was gone from orca-ide worktree ps and everything worked again.

To avoid it entirely: don't open a non-git folder (especially a large tree like a home directory) as a worktree on this runtime.

Expectations

  • Opening a non-git folder (or starting an agent in one) should never be able to wedge the whole runtime for all clients.
  • If a single worktree/PTY handler hangs, it should be isolated to that tab, not block the global RPC layer.
  • A worktree that hung the runtime probably shouldn't be auto-restored on reconnect without a safety check (the current behavior creates a boot-loop).

Metadata

Metadata

Assignees

Labels

orca-remote-serverRemote Orca Server / orca serve / paired remote runtimeos:linuxIssues affecting Linux

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions