GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Linux: desktop backend outlives a crashed desktop in its own systemd scope and locks the T3 home until killed by hand · Issue #41673 · pingdotgg/t3code

Linux: desktop backend outlives a crashed desktop in its own systemd scope and locks the T3 home until killed by hand #41673

New issue
Copy link
New issue
Copy link
Done
#41687
Done
Linux: desktop backend outlives a crashed desktop in its own systemd scope and locks the T3 home until killed by hand#41673
#41687
Copy link
Labels
via-triageFiled through npx t3 triage

Description

@crvouga
crvouga
opened on Nov 23, 2026
Issue body actions

What happened

On Linux, the desktop app's main process crashed (core dump, SIGTRAP). Its backend server did not exit with it. The backend runs in its own transient systemd scope (app-com.t3tools.T3Code-<launcher pid>.scope), outside the cgroup of whatever launched the desktop, so nothing cleaned it up. The orphan:

  • was reparented to systemd --user,
  • kept server-owner.sqlite (and its -journal) open, holding the T3 home lock,
  • stopped answering on its advertised port 3773 (curl refused), though it was still alive in ep_poll.

Every relaunch of the desktop then failed with "Another T3 Code server … is using this T3 home". The desktop did not recover by itself: the app was relaunched 31 times over about 2 hours, all blocked by the same orphan. Stopping the orphan's scope fixed it immediately.

This is the Linux side of what #41401 just fixed for macOS. That fix (DesktopBackendRecovery, MacProcessAuditToken) only covers the packaged macOS app.

Diagnosis

  • At 12:07:47 the desktop main process exited with code=dumped, status=5/TRAP. systemd killed every process in the launcher's cgroup, but the backend (t3code --require …/compileCache.cjs …/apps/server/dist/bin.mjs --bootstrap-fd 3) was in app-com.t3tools.T3Code-3844072.scope, so it survived.
  • server-runtime.json still named the orphan's pid, with origin http://127.0.0.1:3773.
  • Each new desktop polled DesktopHomeOwner.isHomeOwnershipLocked every 250 ms and never started a backend.
  • Each stuck desktop also ignored SIGTERM while waiting, so stopping it took systemd's full 90 s stop timeout before SIGKILL.
  • systemctl --user stop app-com.t3tools.T3Code-<pid>.scope freed the lock, and the next launch came up normally.

Unlike #39188, the old server never exits here, so retrying when the lock frees would not help. The desktop has to recognise and stop its own orphaned backend, as #41401 does on macOS. On Linux the backend's dedicated scope, named after the dead launcher pid, plus a parent of systemd --user/init, may be enough to identify it, alongside a pidfd- or start-time-based record so a reused pid is never signalled.

Steps to reproduce

  1. On Linux (GNOME, systemd user session), run the packaged desktop app with Local environment on, and wait for its backend to come up.
  2. Crash the desktop main process: kill -TRAP <desktop main pid>.
  3. Note the backend still running under app-com.t3tools.T3Code-<main pid>.scope (systemctl --user status 'app-com.t3tools.T3Code-*').
  4. Relaunch the desktop app. It shows that another T3 Code server is using the T3 home, and keeps doing so on every launch until the scope is stopped by hand.

Steps 2–4 describe the failure as observed after a real crash. I did not re-run a deliberate kill -TRAP during triage.

Version

0.1.12-nightly.20261122.5085 (desktop app, Nightly channel). Triage CLI version: the same.

Environment

  • Ubuntu, Linux 7.0 x64, GNOME (desktop run with --ozone-platform=x11)
  • Packaged desktop app installed at /opt/T3 Code (Nightly), launched by a user systemd service (Type=simple, KillMode=mixed, Restart=always)
  • Local environment on, Tailscale Serve on, T3 Connect tunnel (cloudflared) running under the backend
  • No t3code.service background service running

Evidence

12:07:47 systemd: t3code-desktop.service: Main process exited, code=dumped, status=5/TRAP
12:07:47 systemd: t3code-desktop.service: Killing process … (t3code) with signal SIGKILL.   (×15, none of them the backend)
12:07:54 systemd: Started t3code-desktop.service
… 31 desktop launches between 12:00 and 14:07, none of which started a backend

Orphan at 14:07 (about 2 h after the crash):

PID      PPID  STARTED       CMD
3844244  2443  Nov 22 18:25  /opt/T3 Code (Nightly)/t3code --require …/compileCache.cjs …/apps/server/dist/bin.mjs --bootstrap-fd 3
         ^ systemd --user

app-com.t3tools.T3Code-3844072.scope   active (running)   (launcher 3844072 gone)
  ├─3844244 t3code … bin.mjs --bootstrap-fd 3
  ├─t3-resource-monitor
  └─cloudflared tunnel … run

fd 3  -> ~/.t3/userdata/server-owner.sqlite
fd 41 -> ~/.t3/userdata/server-owner.sqlite-journal
curl http://127.0.0.1:3773/.well-known/t3/environment -> connection refused

Each new desktop's trace showed only repeated DesktopHomeOwner.isHomeOwnershipLocked spans, 250 ms apart.

Related issues

  • fix(desktop): recover frozen macOS backends on relaunch #41401: same fix, macOS only (merged 2026-11-23, after this build)
  • [Bug]: Desktop backend outlives a crashed main process and keeps its port, so the relaunch silently moves to another port #13747: backend outlives a crashed main process (closed)
  • [Bug]: Quitting the desktop app leaves its server running, so the next launch cannot start one #22983: quitting the desktop leaves its server holding server-owner.sqlite (closed)
  • Desktop gives up on a slow-exiting old server after 10 s and never retries, so it sits with no backend after the home frees #39188: desktop gives up on a slow-exiting old server and never retries
  • Home-ownership dialog gives the same advice for an old and a current background service, and never mentions turning off Local environment #22820: home-ownership dialog advice

Workaround

systemctl --user stop 'app-com.t3tools.T3Code-<dead launcher pid>.scope'

Then relaunch the desktop.

Agent

Triaged and written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, via t3 triage.

Activity

  1. crvouga
    added
    via-triageFiled through npx t3 triage
    on Nov 23, 2026
  2. juliusmarminge
    closed this as completedin #41687on Nov 23, 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

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.