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

オープン
#1,413 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, bash
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
0
フォーク
4
平均マージ
5時間 19分
マージ済み PR(30日)
503

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Controlvar/controlvar のほかの issue

Controlvar/controlvar の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。