ate-env <id> shell --timeout exits 137 with empty stdout/stderr (no timeout message)

Aperta
#118 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Start with cmd/ate-env/main.go:93-129 to trace how shell --timeout handles non-zero exits, then read guest/process/tracker.go:384-392 and :178-183 to see how timeout kills become exit code 137. Check clients/go/env.go:63-123 and clients/go/types.go:50-52 for the response data available to the CLI. Done means timeout expiry is distinguishable to users, and the unsupported exec invocation reports the missing command clearly.

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

Descrizione

Summary & Root Cause

The guest kills a timed-out process with SIGKILL but keeps no "timed out" flag, so the Process proto and ShellResponse carry only 137. The CLI exits with that code and prints nothing, which makes a --timeout expiry look the same as an OOM kill or an external kill -9.

For exec: the CLI has no such subcommand. ate-env alice exec --timeout 2s -- sleep 10 falls through to the guest command itself, and Cobra rejects --timeout before it reports that exec is not a command. The unknown flag: --timeout message points at the flag rather than the missing command.

Affected Code Locations

All at env 40a6c63, unchanged at de462e98:

  • cmd/ate-env/main.go:93-129: shell --timeout flag (:128). On a non-zero exit, RunE calls os.Exit(res.ExitCode) (:121-123) without printing anything
  • cmd/ate-env/main.go:69-91, 129: the guest command has only read, write and shell. There is no exec subcommand at either SHA
  • guest/process/tracker.go:384-392: on timeout, time.AfterFunc(timeout, ...) sends SIGKILL, and nothing records that the kill came from the timeout
  • guest/process/tracker.go:178-183: a signalled process is reported as ExitCode = 128 + signal (137)
  • clients/go/env.go:63-123: Env.Run returns only Stdout, Stderr and ExitCode
  • clients/go/types.go:50-52: ExitCode is documented as 128 plus the signal number (for example 137 for SIGKILL)
Detailed Reproduction Guide
time ate-env alice shell --timeout 2s 'sleep 10'; echo "exit: $?"
ate-env alice exec --timeout 2s -- sleep 10; echo "exit: $?"
Expected vs. Actual Behavior
  • Expected: On timeout, stderr shows something like ate-env: command timed out after 2s and was killed, ideally with a distinct exit code or flag. exec either exists with --timeout, or fails with unknown command "exec".
  • Actual: After about 2.1s the command exits 137 with 0 bytes on stdout and stderr. exec --timeout fails with ate-env: unknown flag: --timeout.
Observed Output & Logs
$ ate-env alice shell --timeout 2s 'sleep 10'
EXIT: 137
OUTPUT (0 bytes):
$ ate-env alice exec --timeout 2s -- sleep 10
ate-env: unknown flag: --timeout
EXIT: 1
$ ate-env alice shell --timeout 2s sleep 10
EXIT: 137  (2.10s, 0 bytes output)
$ ate-env alice exec --timeout 2s -- sleep 10
EXIT: 1
ate-env: unknown flag: --timeout
Lingua principale
Go
Stelle
71
Fork
17
Merge medio
21h 36m
PR unite (30g)
19

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 agent-substrate/env

Tutte le issue di agent-substrate/env

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.