HIL: Ctrl-C terminates the board worker before its lock task logs the failure

Aperta
#4,500 1 commento 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
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, raspberry-pi

Direzione di ricerca

Start with test/hil/hil_test.py and trace main(), drain_pool, pool shutdown, and _abort_report to see how KeyboardInterrupt is handled. Check the board task's lock and failure logging path, then reproduce the Ctrl-C case on hardware. Done means the run writes an abort report, logs a failed event with its receipts, and leaves no stale lock record.

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

Descrizione

follow-up Prio 📌

A Ctrl-C on test/hil/hil_test.py leaves the board's lock record stale instead of ending its task as failed. The
run also writes no report.

Evidence

  • ci.lan, raspberry_pi_pico, #4499's branch with agentrc 48d46bbf. SIGINT went to the run's process group after 4
    tests:
    • The run exited 130 with no report.
    • The lock record stayed stale (cleanupOwed: true, the board worker's pid), and no failed event was logged.
    • All 14 idle pool workers printed KeyboardInterrupt tracebacks. The board worker printed nothing.
  • The next run on the board reported it as previous-cleanup-failure (found-left). Its park logged restored for
    it, so recovery works; only the interrupted run's own record of the failure is lost.

Cause

This is read from the source and is not yet confirmed by a trace:

  • Main's KeyboardInterrupt in drain_pool is not caught by except Exception in main().
  • Leaving with pool: therefore calls Pool.terminate(), which sends SIGTERM to every worker.
  • The board worker has no SIGTERM handler, so it dies before its board_task can end the task and log the failure.
  • _abort_report is skipped for the same reason, which is why there is no report.

Remaining work

  • On KeyboardInterrupt in main(), let in-flight workers end their board task (bounded join, or close() +
    join(timeout)) before terminate(). Write the abort report as the other abort paths do.
  • Confirm on hardware that a Ctrl-C then logs a failed event with the run's receipts and leaves no stale record.

Deferred: the pool shutdown predates #4499 and the recovery path covers it.

Lingua principale
C
Stelle
7.3k
Fork
1.6k
Merge medio
1g 19h
PR unite (30g)
67

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 hathach/tinyusb

Tutte le issue di hathach/tinyusb

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.