bug(compute-driver): lifecycle RPCs carry a name field that cannot identify a sandbox
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend, backend-api-design
Línea de trabajo
Start with the lifecycle request definitions in proto/compute_driver.proto, then read DriverSandbox.workspace and the ComputeManager::stop_sandbox call site in crates/openshell-server/src/compute/mod.rs. Review #3253, #3254, #3278, and #3305 before determining the contract direction. Done means the four lifecycle requests and ListSandboxesRequest are consistent, the rationale is documented, and a two-workspace same-name regression protects at least one driver.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
User Story
As a compute-driver implementer, I want the driver-facing lifecycle RPCs to carry a sandbox reference sufficient to identify exactly one sandbox, so that I do not have to choose between trusting sandbox_id blindly and resolving an ambiguous name.
Problem Statement
StopSandboxRequest, StartSandboxRequest, DeleteSandboxRequest, and GetSandboxRequest in proto/compute_driver.proto carry {sandbox_id, name}. The name field is the plain sandbox name (object_name()), which is unique per workspace, not globally. No workspace accompanies it, so name alone cannot identify a sandbox.
This is inconsistent with the rest of the same contract:
| Driver RPC | Carries workspace |
|---|---|
CreateSandbox |
Yes, via DriverSandbox.workspace |
EnsureWorkspace / DeleteWorkspace |
Yes, workspace |
GetSandbox |
No |
StopSandbox |
No |
StartSandbox |
No |
DeleteSandbox |
No |
ListSandboxes |
No (empty request) |
DriverSandbox.workspace (proto/compute_driver.proto:163-165) is documented as "Used by drivers to construct collision-safe resource names and labels in shared-namespace mode." The contract therefore supplies workspace at create time specifically for collision safety, then withholds it on every subsequent lookup of the same resource.
The gateway holds the workspace at each of these call sites. ComputeManager::stop_sandbox(workspace, name) uses it to resolve the sandbox from the store, then constructs StopSandboxRequest { sandbox_id, name: sandbox_name } without it (crates/openshell-server/src/compute/mod.rs:1239, call site at :1346).
Impact / Why This Matters
Two drivers shipped the predictable bug. #3254 (VM) and #3253 (MXC) both fell back to name-only resolution when sandbox_id was absent, and both could act on a same-named sandbox in another workspace. These were fixed in #3305 and #3278 by making sandbox_id strictly authoritative.
Docker, Podman, and Kubernetes avoided the same bug only incidentally, by threading workspace into runtime identity at create time (container_name(workspace, name, id), managed_namespace(gateway_id, workspace)). That is a per-driver convention, not a contract guarantee. VM and MXC key their registries on id alone, which is why they were the two affected drivers.
The current workaround — id-authoritative resolution implemented separately in each driver — fixes the two known instances. It does not prevent the next driver from reading name and reaching the same conclusion, because the field is still present and still appears usable.
proto/compute_driver.proto is explicitly a gateway/compute-driver extension contract for independently versioned external drivers. An external implementer reading {sandbox_id, name} has no way to learn that name is insufficient, and no workspace available to reconcile or garbage-collect platform state against.
Acceptance Criteria
- A decision is recorded on whether the driver lifecycle sandbox reference is ID-only or
(sandbox_id, workspace, name). -
StopSandboxRequest,StartSandboxRequest,DeleteSandboxRequest, andGetSandboxRequestreflect that decision consistently. -
ListSandboxesRequestis addressed under the same decision. -
proto/compute_driver.protodocuments why the driver boundary differs from the public(workspace, name)contract, perproto/README.mdconventions. - At least one driver enforces the resulting contract with a regression covering two workspaces that share a sandbox name.
- The id-authoritative fixes in #3305 and #3278 remain correct under the chosen option.
Reproduction Steps
This is a contract defect rather than a runtime failure on current main; both known runtime instances are now fixed. To observe the underdetermined reference:
- Read
message StopSandboxRequestatproto/compute_driver.proto:398. It declaressandbox_idandnameonly. - Read
DriverSandbox.workspaceatproto/compute_driver.proto:163-165, supplied toCreateSandboxfor collision-safe naming. - Read
ComputeManager::stop_sandboxatcrates/openshell-server/src/compute/mod.rs:1239. It receivesworkspace, resolves the sandbox withget_message_by_name::<Sandbox>(workspace, name), then builds the driver request at:1346without the workspace. - Create two sandboxes with the same name in different workspaces. The driver receives the same
namevalue for both; onlysandbox_iddistinguishes them.
For the empirical form of the defect, see the pre-fix behavior described in #3253 and #3254.
Environment
- OpenShell:
mainat 7139df8ca - OS: not environment-specific
- Runtime, deployment, or integration:
proto/compute_driver.protoextension contract; observed inopenshell-driver-vmandopenshell-driver-mxc, contract applies to all compute drivers
Notes
Two coherent resolutions exist and this issue does not choose between them:
Option A — drop name. Make these RPCs ID-only. sandbox_id is globally unique and stable, which is sufficient for lookup and consistent with the "immutable IDs remain internal to compute-driver boundaries" line drawn in #3050/#3272. Drivers needing a human-readable name already receive it at create.
Option B — complete the reference. Add workspace to the four requests, populated from the record the gateway has already resolved. sandbox_id stays authoritative for lookup; (workspace, name) becomes a complete secondary reference for reconciliation, labelling, and cross-checking.
Surface ownership sits with @drew, who is currently considering the compute-driver direction. This issue records the inconsistency and the open decision; it does not propose a resolution.
Parent: #2565, which scopes extension contracts including compute drivers. #3050 (closed by #3272) performed the equivalent review for the public gateway RPCs and standardized them on (workspace, name); the compute-driver surface was intentionally left on internal IDs and has not been revisited since.
Related: #3253, #3254, #3278, #3305.
- Lenguaje dominante
- Rust
- Estrellas
- 8.7k
- Forks
- 1.3k
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 271
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/OpenShell
-
area:docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
state:triage-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
area:cli state:validated
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
state:triage-needed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
area:build spike state:review-ready state:stale
Dificultad 2/5 Medio día Aptitud para principiantes 68/100
Todos los issues de NVIDIA/OpenShell
Issues similares
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
n0-computer/iroh#4550 ·
-
impl detach for native Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
paritytech/zombienet-sdk#591 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
farion1231/cc-switch#7638 · 1 comentario ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100