Skip to content

sandbox-relay: an in-stream ExecError returns a gRPC OK status, so a failed Exec counts as a success #295

Closed

Description

@pdettori

packages/sandbox-relay/src/relay.ts's routeExec yields an in-stream ExecEvent.error and then
returns normally — which is a gRPC OK status. So a caller that judges success by the RPC status
sees a failed Exec as a successful one.

// packages/sandbox-relay/src/relay.ts, routeExec
while (queue.length) {
  const ev = queue.shift()!;
  yield ev;
  if (ev.end || ev.error) return;   // <-- ExecError ends the stream with status OK
}

Why it matters

grpcurl exits 0 on an OK status, and deploy/microvm/e11-density.sh's grpc_exec_record
classifies purely on that exit code. So on the E11 density benchmark's container and microvm
arms, an ExecError-failed Exec today:

  • counts toward throughput — inflating the numerator with work that did not happen;
  • enters the distribution p95Ms is taken over — and a refusal is usually fast, so it drags p95
    toward "healthy";
  • never reaches execErrorsByCause, which is the field spec §7.3 exists to populate and which is
    supposed to make a failure diagnosable;
  • feeds coldAcquireRate, which is a latency-classification proxy computed from those same
    latencies.

The net direction is optimistic: the more Execs fail this way, the healthier the rung looks.

How it was found

Reading the wire contract while implementing #294 (a persistent-connection Go Exec client). It is
pre-existing and unrelated to that change.

Current state

Sequencing consequence

This blocks any cross-client comparison on the container or microvm arms: the two clients
provably disagree there, so a grpcurl-driven ladder and a go-driven ladder are not comparable on
throughput, p95Ms or execErrorsByCause until this is fixed. #294's driver-control comparison
is unaffected.

Candidate fix

Decide what an ExecError should mean on the wire and make it unambiguous — most likely have
routeExec end the stream with a non-OK gRPC status carrying the ExecError.message, so a
status-only caller cannot mistake it for success. That is a contract change for every consumer
(packages/k8s-sandbox, the harness seam, e11-density.sh), so it wants deciding rather than
patching. Whatever is chosen, grpc_exec_record's exit-code-only classification needs updating with
it, and §E11's affected conclusions need re-examining.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions