feat(gateway): handle launched-driver socket paths that exceed the Unix socket limit

Aperta
#5,935 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start where the gateway binds each launched driver's socket under $XDG_STATE_HOME/openshell/run/launch-XXXXXX/driver.sock, and compare it with the VM driver's existing over-long per-sandbox socket check. Decide between an explicit length error and a private /tmp/openshell-<uid> fallback, then add a unit test that uses a long base directory. Done means a long state directory no longer yields a bare SUN_LEN bind error and any fallback warning names the location.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:drivers

User Story

I use OpenShell with launched compute drivers (Docker, Podman, VM) and run the gateway under state directories of varying depth, including CI workspaces. I directly encountered the gateway failing to start a driver because its socket path was too long. This affects whether the gateway starts at all.

Problem Statement

The gateway binds each launched driver's Unix socket under $XDG_STATE_HOME/openshell/run/launch-XXXXXX/driver.sock. A Unix socket path is limited to about 104 bytes on Linux and macOS. When the state directory is deep, the driver fails to bind with path must be shorter than SUN_LEN and the gateway does not start. The gateway does not check the length and has no way to recover.

Impact / Why This Matters

Operators with long XDG_STATE_HOME values, such as CI workspaces or per-user directories on shared hosts, get an opaque bind error. Their workaround is to choose a shorter state directory. The VM driver already rejects over-long per-sandbox socket paths with an explicit error, so behaviour is inconsistent.

Desired Workflow

The gateway checks the socket path length before it starts a driver. When the path would be too long, it either names the cause and the fix in the error, or places the launch directory under a short private location such as /tmp/openshell-<uid> (owner-only, checked as the existing socket directory is) and logs a warning. Success: a long state directory never produces a bare SUN_LEN bind error.

Acceptance Criteria

  • A state directory long enough to exceed the socket path limit does not produce a bare bind error.
  • If a fallback location is used, it is private to the gateway's user and the warning names it.
  • A unit test covers a long base directory.

Related: #5384, #5385. Deferred from the launcher PR to keep that change free of new behaviour.

Lingua principale
Rust
Stelle
21.5k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/OpenShell

Tutte le issue di NVIDIA/OpenShell

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.