AWS installer (beta): an interrupt during the deploy wait can occasionally be ignored

Aperta
#1,413 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, bash
Ambito
cli

Direzione di ricerca

Start with deploy/aws-installer/lib/steps.sh, especially cv_deploy_wait, and inspect the heartbeat command substitutions in steps.sh and checks.sh. Run the installer test test_an_interrupt_leaves_a_usable_record_and_no_child[during-the-deploy-to-the-installer-INT] with the wait tick set to 0 to reproduce the race. Done means both direct-process and process-group SIGINT deliveries stop the installer, leave a usable record and no child, and the regression test covers both deliveries.

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

Descrizione

bug post-launch

What happens

While controlvar-aws install waits for a CloudFormation deploy, an interrupt (SIGINT) can occasionally be ignored,
so the install carries on instead of stopping and writing its record. This applies to an interrupt sent to the
installer's own process (for example kill -INT <pid>) and, more rarely, to Ctrl-C in the terminal (which signals the
whole process group): pressing Ctrl-C again stops it. SIGTERM is acted on.

Why

bash does not replay a trapped SIGINT that arrives while the shell is collecting a command substitution $(...)
whose child has finished (command substitutions are not in bash's jobs table). The deploy-wait loop takes the time with
now=$(date +%s) on every tick (deploy/aws-installer/lib/steps.sh, cv_deploy_wait), and the first heartbeat runs
a few more substitutions (steps.sh, checks.sh).

Measured

The installer test test_an_interrupt_leaves_a_usable_record_and_no_child[during-the-deploy-to-the-installer-INT]
(which sets the wait tick to 0, so the loop spins) ignores the INT in about 1 of 200 runs on bash 5.3 and 3.2; with
the INT sent to the whole group, 3 of 300 runs. When the date child is made to linger after its output, an INT to
the installer alone is ignored 8 of 8 times. With the tick at its default of 5 seconds the window is a tiny fraction of
each tick.

Proposed fix

Take the time from bash's $SECONDS instead of $(date +%s) in the wait loop (start and deadline from the same
clock), keep command substitutions out of the main shell's wait loop (the heartbeat included), and keep the test above
(both deliveries) as the regression test.

Lingua principale
Python
Stelle
0
Fork
4
Merge medio
5h 19m
PR unite (30g)
503

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 Controlvar/controlvar

Tutte le issue di Controlvar/controlvar

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.