diff --git a/docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md b/docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md new file mode 100644 index 0000000000..09e30288c0 --- /dev/null +++ b/docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md @@ -0,0 +1,213 @@ +--- +schema-version: 1 +doc-type: issue +issue-type: bug +status: done +priority: p1 +epic: null +github-issue: 2855 +spec-path: docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md +branch: "2855-container-regression-timeout-sigint-spec" +related-pr: 2857 +last-updated-utc: "2026-11-14 08:40" +semantic-links: + skill-links: + - create-issue + related-artifacts: + - .github/skills/dev/debugging/fix-bug/SKILL.md + - .github/skills/dev/planning/create-issue/SKILL.md + - contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh +--- + + + +# Issue #2855 - Container regression script fails when `timeout` is uutils + +## Goal + +Make `test-mounted-no-persistence-configuration.sh` stop the tracker container reliably with +SIGINT regardless of which `timeout` implementation (GNU or uutils) the host provides, so the +"Test (Docker) (release)" job of the Container workflow is green again on `develop`. + +## Background + +The Container workflow step "Run Persistence Transition Regression" fails with exit code 1 on +`develop` and on unrelated PR branches (develop runs 43184363486, 43225433196, 43299605132; last +success 43059027926 on 2026-11-11 16:30 UTC). The diff between the last success and the first +failure touches only `docs/`, so no repository change caused it. + +What happens, step by step: + +1. `run_tracker` runs `timeout --signal=INT --kill-after=3s 10s docker run --rm ... `. +2. After 10 s `timeout` must deliver SIGINT to the `docker` client, which forwards it to the + tracker (PID 1 in the container). The tracker then logs `Torrust tracker shutting down (SIGINT)` + and exits 0; the script accepts exit status 0 or 124. +3. With the **uutils** `timeout` (the default `timeout` on Ubuntu 26.04, `rust-coreutils`), run + without `--foreground`, the tracker never receives SIGINT: it keeps running, `--kill-after=3s` + SIGKILLs the `docker run` client after 3 s instead, the status is 137, and the script's + `test "${exit_status}" -eq 0 -o "${exit_status}" -eq 124` (line 39 at `ec1f58ec9`, the last + `develop` commit before PR #2857's fix merged) fails, ending the step with + exit 1. The tracker log shows no shutdown line, matching the failing CI logs. Whether the + signal reaches the client and is not forwarded, or never reaches the client at all, is a + hypothesis (`manual-verification-evidence.md` V2); the fix below is correct under either + reading. + +The tracker is not at fault: `docker kill --signal=INT` and `--signal=TERM` both stop the image +cleanly with exit 0, and `kill -INT ` does too. GNU `timeout` (with or without +`--foreground`) and uutils `timeout --foreground` also work. + +Impact: the Container workflow is red on every `develop` push and PR run on the self-hosted +runner, hiding real regressions and blocking the E2E steps that follow it in the job. Each failed +run also leaves its tracker container running: `docker run --rm` only removes the container on +exit, and `--kill-after` kills the attached client, not the container, so it never exits. The +runner's daily prune (`contrib/dev-tools/self-hosted-runner/docker-ci-prune.sh`) only removes +*stopped* containers, so these accumulate: 34 were running on the runner at the time of writing, +all identifiable as this script's by image and mount pattern, and none stopped +(`manual-verification-evidence.md` V5). The oldest of them predates the last known-green Container +run, so at least that one is not explained by this regression; the rest, created after the first +red run, are consistent with it but not individually proven to be caused by it. + +Why it regressed with no repository change: the job runs on the self-hosted `torrust-hetzner` +runner (`torrust-runner-01`, Ubuntu 26.04.1), whose `timeout` is the uutils one. The runner's +apt history (`/var/log/apt/history.log`) shows `rust-coreutils` upgraded from 0.8.0 to +0.10.0-1ubuntu2~26.04.1 on 2026-11-12 06:36 UTC, between the last green run (2026-11-11 16:30) +and the first red run (2026-11-12 08:36). The failure was reproduced locally with the same +version, 0.10.0. That 0.8.0 passed the script is inferred from the green runs, not tested. + +## Scope + +### In Scope + +- Make the `timeout` invocation in `run_tracker` deliver SIGINT to the docker client on both + implementations (`--foreground`). +- Print the unexpected exit status when `run_tracker` fails, so the next failure is diagnosable. + +### Out of Scope + +- Changing tracker shutdown code (verified correct). +- Changing the runner image or pinning its coreutils. +- Removing the leftover containers already accumulated on the runner (`manual-verification-evidence.md` + V5); that changes shared-runner state and is left to the maintainer or a follow-up. + +## Architectural Decisions + +- Related ADRs: `docs/adrs/20260926142648_adopt_self_hosted_hetzner_runner_for_container_tests.md` +- ADRs to create: None known + +## Design and Ownership Review + +Not applicable. + +## Bug-Fix Process + +Follows `.github/skills/dev/debugging/fix-bug/SKILL.md`. Analysis and reproduction (outcome: +**Reproduced**) are recorded in `manual-verification-evidence.md`. + +## Regression Test Strategy + +The maintained regression test is the script itself, which already fails (exit 1) on the broken +`timeout` invocation. A unit test is not practical because the defect is a host-tool and +process-boundary interaction. Red is proven by the local run before the fix; green by the same +run after it, plus the Container workflow on the fix PR. + +## Implementation Plan + +| ID | Status | Task | Notes / Expected Output | +| --- | ------ | ------------------------------------------------------------------------- | -------------------------------------------- | +| T1 | DONE | Reproduce and record evidence | `manual-verification-evidence.md` V1, V2 | +| T2 | DONE | Record red run of the script before the fix | Evidence V1: `RUN_TRACKER_STATUS=137`, exit 1 | +| T3 | DONE | Add `--foreground` to `timeout`; report the unexpected status on failure | Script change only; PR #2857 merged into `develop` | +| T4 | DONE | Green run locally and Container workflow green on the PR | Evidence V3 (local); PR #2857's `Test (Docker) (release)` job passed | + +## Commit Points + +| Task | Coherent change set | Commit policy | +| ---- | -------------------------------------------------------- | ---------------------------------------------------- | +| T3 | `fix(container): [#2855] stop the tracker with timeout --foreground` (PR #2857; identify by this Conventional Commit subject, not a branch commit id, which a rebase onto `develop` can rewrite) | Commit after focused validation and required review. | + +## Progress Tracking + +### Workflow Checkpoints + +- [x] Folder-style spec drafted in `docs/issues/open/2855-container-regression-timeout-sigint/ISSUE.md` +- [x] Spec reviewed and approved by user/maintainer +- [x] GitHub issue created and issue number added to this spec +- [ ] Spec-only PR merged into `develop` before implementation +- [x] Implementation completed (on PR #2857's branch; that PR had already been opened and + reviewed before this checkpoint was reconciled — see the 2026-11-13 11:20 UTC progress-log + entry for the process deviation from the recommended spec-first PR sequence) +- [x] Automatic verification completed (`linter all`, relevant tests, and any pre-push checks) +- [x] Manual verification scenarios executed and recorded in issue-local `manual-verification-evidence.md` +- [x] Acceptance criteria reviewed after implementation and updated with evidence +- [x] Evidence-based implementation completion review recorded: issue-local retrospective created for material discoveries, or progress log states why none was needed +- [ ] Reviewer validated acceptance criteria and updated checkboxes +- [ ] Independent reviewer reports recorded in issue-local `agent-review-reports.md` when reviewers received this folder-style specification +- [ ] Committer verified spec progress is up to date before commit +- [x] Issue closed and spec moved from `docs/issues/open/` to `docs/issues/closed/` + +### Progress Log + +- 2026-11-13 10:10 UTC - Claude Code (Claude Sonnet 5.5) - Drafted spec, reproduced the failure locally - `manual-verification-evidence.md` +- 2026-11-13 10:12 UTC - Claude Code (Claude Sonnet 5.5) - Runner apt history confirms rust-coreutils 0.8.0 to 0.10.0 on 2026-11-12; issue #2855 created; spec moved to open/ - evidence V4 +- 2026-11-13 11:20 UTC - Claude Code (Claude Sonnet 5.5) - Opened implementation PR #2857 (T3 commit) before this spec-only PR merged, deviating from the recommended spec-first PR sequence in `create-issue` (implementation was started in parallel rather than after merge); addressed PR #2856 review findings F1-F7: re-ran V1/V2 with recorded repeatable commands, added V3 (green recheck) and V5 (leftover-container evidence), rewrote the Background mechanism claim as a hypothesis, updated Scope, Implementation Plan and checkpoints - `manual-verification-evidence.md` V1-V5 +- 2026-11-13 15:20 UTC - Claude Code (Claude Sonnet 5.5) - Addressed PR #2856 round-2 review findings F8-F14: re-ran V5 on the runner with a full container list, an exited-count check and image/mount identification (32 containers, not the 31 this entry originally stated — the later round-4 recapture showed exactly 2 containers newer than this capture's newest, so this capture held at least 34 - 2 = 32, matching its own listing's row count of 3 + 27 + 2; see PR-REVIEW.md F29. This 15:20 stamp is itself backfilled, no later than the 15:23:59 UTC commit that carries it), all this script's, oldest predating the last green run, softened the Impact claim, named the fixing commit in V3, fixed the V1 diff (removed a no-op pair, added the real `PROJECT_ROOT` edit), fixed this log's backfilled timestamp, and marked T4/AC1-AC3 DONE now that PR #2857's `Test (Docker) (release)` job passed - `manual-verification-evidence.md` V1, V3, V5 +- 2026-11-13 19:44 UTC - Claude Code (Claude Sonnet 5.5) - PR #2857 merged into `develop`; updated T3/AC1 wording and the Impact paragraph's container count in this spec to match +- 2026-11-13 22:18 UTC - Claude Code (Claude Sonnet 5.5) - Addressed PR #2856 round-3 review findings F19-F27 (audit IDs; `da2ce7`'s APPROVED review contributed F19-F24, the automated reviewer's F25-F27): added the audit record's skill-link marker; cited a commit by its Conventional Commit subject instead of an id and corrected the Ownership note's reply-count attribution; re-ran V5 on the runner with a fresh, internally-consistent capture (34 containers, 0 exited, same oldest leftover) and recorded its real capture time, resolving the stale-timestamp and elided-count inconsistencies; corrected the V1 patch's second hunk header and its `cp`-location prose; ran `linter all` and checked the criterion, and added the audit record to the PR description's Files touched list; reclassified F18 as `RE_RAISE_OF:F13` - `manual-verification-evidence.md` V1, V5; `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` +- 2026-11-13 22:45 UTC - Claude Code (Claude Sonnet 5.5) - Addressed PR #2856 round-4 review findings F28-F31: named the pre-fix script by its durable `develop` commit id `ec1f58ec9` instead of a `cp` of the now-fixed working tree or an unqualified line number; corrected the round-2 progress-log entry's container count (31 to 32) and timestamp; posted the F14 correction on F14's own thread instead of F16's, and removed an incorrect "(inferred)" tag from F25-F27; rewrote the round-3 progress-log entry to cite audit IDs instead of the automated reviewer's own labels - `manual-verification-evidence.md` V1; `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` +- 2026-11-13 22:55 UTC - Claude Code (Claude Sonnet 5.5) - Addressed PR #2856 round-5 Copilot review finding (archive the completed issue): PR #2857 merged and closed #2855 at 19:44 UTC, so this spec and its evidence file moved from `docs/issues/open/` to `docs/issues/closed/`, with `status: done`, `spec-path`, and the evidence file's `issue-spec` reference updated to the new location. The review's other new finding ("pin V1 to the pre-fix script") was already resolved by the round-4 F28 fix. +- 2026-11-13 23:05 UTC - Claude Code (Claude Sonnet 5.5) - Addressed PR #2856 round-6 review findings F34-F37: corrected the round-2 entry's swapped container-count claim and its timestamp form, and added the run-from-repository-root note to V1's setup - `manual-verification-evidence.md` V1; `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` +- 2026-11-14 08:06 UTC - Claude Code (Claude Opus 5.5) - Addressed PR #2856 round-7 review findings F38-F42: reworded the archive commit's message so it no longer carries a closing keyword before an issue reference (subject unchanged); recorded the completion review in `implementation-retrospective.md` and re-reviewed the acceptance criteria against V3 and PR #2857's merged state, checking both related boxes (that re-review was a reading of the merged diff, not a run; the 08:40 UTC entry records the rerun); listed the `closed/` paths in the PR description; corrected the round-6 audit timeline and advanced both files' `last-updated-utc` - `implementation-retrospective.md`; `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` +- 2026-11-14 08:40 UTC - Claude Code (Claude Opus 5.5) - Addressed PR #2856 round-8 review findings F43-F44: V3 predated PR #2857's review-fix commit (which replaced the exit-status `test` with a `case`), so reran V3 on the merged script at `develop` `24230dd01` under uutils `timeout` 0.10.0 and GNU `timeout` 9.7 (both exit 0, four SIGINT shutdowns each); added PR #2857's final-head `Test (Docker) (release)` run to AC3; corrected the retrospective's claim that the fix did not change; noted the history rewrite in the PR description - `manual-verification-evidence.md` V3 rerun; `implementation-retrospective.md`; `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` + +## Acceptance Criteria + +- [x] AC1: `test-mounted-no-persistence-configuration.sh` passes with uutils `timeout` 0.10.0 + (PR #2857, merged into `develop`). +- [x] AC2: It still passes with GNU `timeout` (same branch). +- [x] AC3: The Container workflow "Test (Docker) (release)" job is green on PR #2857. +- [x] `linter all` exits with code `0` +- [x] Acceptance criteria are re-reviewed after implementation and reflect actual behavior + +## Verification Plan + +### Automatic Checks + +- `linter all` +- The regression script with `timeout` and `gnutimeout` + +### Manual Verification Scenarios + +| ID | Scenario | Human-oriented command/steps | Expected Result | Status | Evidence | +| --- | ---------------------------------- | ------------------------------------------------------------------------- | ---------------------- | ------ | -------------------------------------------- | +| M1 | Reproduce the failure | Run the script against a locally built release image | Status 137, exit 1 | DONE | `manual-verification-evidence.md` section V1 | +| M2 | Isolate the cause | Run the container under each `timeout` variant | Only uutils w/o flag fails | DONE | `manual-verification-evidence.md` section V2 | +| M3 | Recheck after the fix | Rerun the fixed script with uutils `timeout`, then with GNU `timeout` via `PATH` | Exit 0, both times | DONE | `manual-verification-evidence.md` section V3 | +| M4 | Runner package history | `ssh torrust-runner-01` apt history, dpkg, and `timeout --version` | rust-coreutils upgrade 2026-11-12 | DONE | `manual-verification-evidence.md` section V4 | +| M5 | Leftover containers on the runner | `ssh torrust-runner-01 'docker ps -a'` | Running containers accumulate; prune does not remove them | DONE | `manual-verification-evidence.md` section V5 | + +### Acceptance Verification + +| AC ID | Status | Evidence | +| ----- | ------ | -------- | +| AC1 | DONE | `manual-verification-evidence.md` V3 and V3 rerun on the merged script (uutils runs) | +| AC2 | DONE | `manual-verification-evidence.md` V3 and V3 rerun on the merged script (GNU runs via `PATH`) | +| AC3 | DONE | PR #2857 `Test (Docker) (release)` job on its first fix commit: https://github.com/torrust/torrust-tracker/actions/runs/43410972003/job/131846372838; and on its final head, after the review-fix commit: https://github.com/torrust/torrust-tracker/actions/runs/43456290657/job/132113463710 | + +## Risks and Trade-offs + +- `--foreground` only signals the direct child; this is what is wanted (the docker client). No + other process in the script depends on group signalling. +- The 0.8.0 behavior was not tested directly; the fix is correct for both implementations regardless. + +## Implementation Completion Review + +- Retrospective: `implementation-retrospective.md` (plan deviation: implementation PR opened + before the spec-only PR merged; reusable lessons on durable pre-fix references and + `timeout --foreground`) + +## References + +- Failing runs: 43184363486, 43225433196, 43299605132; last success 43059027926 +- Related ADR: `docs/adrs/20260926142648_adopt_self_hosted_hetzner_runner_for_container_tests.md` +- Related issues: #2855 +- Related PRs: #2856 (spec-only), #2857 (implementation) diff --git a/docs/issues/closed/2855-container-regression-timeout-sigint/implementation-retrospective.md b/docs/issues/closed/2855-container-regression-timeout-sigint/implementation-retrospective.md new file mode 100644 index 0000000000..072ebe27a2 --- /dev/null +++ b/docs/issues/closed/2855-container-regression-timeout-sigint/implementation-retrospective.md @@ -0,0 +1,83 @@ +--- +semantic-links: + skill-links: + - write-markdown-docs + related-artifacts: + - docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md + - docs/issues/closed/2855-container-regression-timeout-sigint/manual-verification-evidence.md + - contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh + - .github/skills/dev/planning/create-issue/SKILL.md +--- + +# Implementation Retrospective — Issue #2855 + +## Purpose + +Record evidence-based process improvements discovered while fixing #2855 (Container regression +script fails when `timeout` is uutils). This is a blameless review of the implementation approach. + +## Outcome + +`run_tracker` now runs `timeout --foreground --signal=INT --kill-after=3s 10s docker run ...`, so +the tracker receives SIGINT under both GNU and uutils `timeout`, and the script prints the +unexpected exit status when it fails. The merged script passes locally under both +implementations (`manual-verification-evidence.md` V3 rerun, on `develop` at `24230dd01`), and +PR #2857's `Test (Docker) (release)` job passed on its final head, which includes the review-fix +commit, before it merged into `develop`. + +## What Went Well + +1. Isolating the cause with a matrix of signal paths (`docker kill`, `kill -INT`, GNU and uutils + `timeout`, with and without `--foreground`; evidence V2) cleared the tracker's shutdown code + quickly and pointed at a single invocation. +2. The runner's apt history (evidence V4) explained why a docs-only diff turned the workflow red: + an unattended `rust-coreutils` upgrade between the last green and first red runs. + +## What Changed During Implementation + +- The implementation PR (#2857) was opened before this spec-only PR (#2856) merged, against the + spec-first sequence in `create-issue`. The fix itself changed after the spec review began: PR + #2857's review-fix commit, `fix(container): [#2855] address PR #2857 review findings F2-F4,F7`, + replaced the exit-status `test` with a `case` that prints the unexpected status. V3 had been run + before that commit, so it was rerun on the merged script (V3 rerun). The spec PR also needed many + review rounds to reconcile its checkpoints, evidence and wording with an implementation that had + already moved on (including merging first). +- Leftover containers on the runner were found while gathering evidence (V5): failed runs leave + `docker run --rm` containers running, and the daily prune only removes stopped ones. Cleaning + that backlog was kept out of scope because it changes shared-runner state. +- Evidence first relied on a working-tree copy of the script and unqualified line numbers, which + went stale once the fix merged; it now names the pre-fix script by its `develop` commit + `ec1f58ec9`. + +## Root Cause + +- The regression came from a host-tool behavior difference (uutils `timeout` without + `--foreground`), and the self-hosted runner upgrades packages unattended, so CI behavior can + change with no repository change. +- Running spec and implementation PRs in parallel meant every implementation milestone (job + passing, merge, issue closing) forced another round of spec edits. + +## Improvements for Future Work + +1. Finish and merge the spec-only PR before opening the implementation PR, as `create-issue` + already recommends; the maintainer has confirmed this as the expected sequence. +2. Repeat the final recheck after any review-driven change to the fix, as the `fix-bug` skill + asks, and name the commit it ran on. +3. In evidence, name pre-fix code by a durable `develop` commit id (`git show :`), not + by a working-tree copy or a line number in a file the fix will change. +4. In scripts that wrap `docker run` with `timeout`, pass `--foreground` so the signal reaches the + `docker` client regardless of the `timeout` implementation. + +## Avoiding Overcorrection + +No new rule for pinning runner packages or disabling unattended upgrades is justified by one +incident; the script fix makes it independent of the `timeout` implementation. Cleaning up the +leftover containers is a one-off maintenance action, not a new process. + +## Evidence + +- `docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md` +- `docs/issues/closed/2855-container-regression-timeout-sigint/manual-verification-evidence.md` + V1-V5 +- PR #2857: `fix(container): [#2855] stop the tracker with timeout --foreground` +- `docs/pr-reviews/pr-2856-review/PR-REVIEW.md` diff --git a/docs/issues/closed/2855-container-regression-timeout-sigint/manual-verification-evidence.md b/docs/issues/closed/2855-container-regression-timeout-sigint/manual-verification-evidence.md new file mode 100644 index 0000000000..22783a5744 --- /dev/null +++ b/docs/issues/closed/2855-container-regression-timeout-sigint/manual-verification-evidence.md @@ -0,0 +1,231 @@ +--- +doc-type: manual-verification-evidence +issue-spec: docs/issues/closed/2855-container-regression-timeout-sigint/ISSUE.md +last-updated-utc: "2026-11-14 08:40" +--- + +# Manual Verification Evidence + +## Environment and Prerequisites + +- Date (UTC): 2026-11-13 +- Artifact under test: release image built from `develop` at the merge of #2841 + (`docker build --target release --tag tt:repro -f Containerfile .`, tagged `tt:repro`) +- OS: Ubuntu 26.04, Docker 28.3.3, `timeout` = uutils coreutils 0.10.0 + (`rust-coreutils 0.10.0-1ubuntu2~26.04.1`); GNU `timeout` reached as `/usr/bin/gnutimeout` + (`gnu-coreutils 9.7`, a separate binary installed alongside uutils, not a PATH shim) + +## Verification Processes + +### V1 - Reproduce the failing step + +- Status: `DONE` (outcome: **Reproduced**) + +Setup (not committed; the instrumented copy is not retained as an issue-local artifact because the +complete patch below reconstructs it exactly from the pre-fix script). The working tree's script +now carries the fix (PR #2857, merged into `develop`), so the pre-fix state is named by its +`develop` commit id, `ec1f58ec9` (the last commit before that merge), a durable reference that a +rebase cannot move. Run from the repository root (`git show :` resolves `` from +the tree root regardless of the working directory, but the redirect below writes the copy into +the working directory, which the `PROJECT_ROOT` pinning below assumes is the repository root): + +```bash +git show ec1f58ec9:contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh > ./instrumented-copy.sh +patch ./instrumented-copy.sh <<'PATCH' +--- a/test-mounted-no-persistence-configuration.sh ++++ b/instrumented-copy.sh +@@ -16 +16 @@ +-PROJECT_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../../../.." && pwd) ++PROJECT_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +@@ -37,3 +37,4 @@ run_tracker() { + "${IMAGE_TAG}" || exit_status=$? + ++ echo "RUN_TRACKER_STATUS=${exit_status}" >&2 + test "${exit_status}" -eq 0 -o "${exit_status}" -eq 124 +PATCH +``` + +`PROJECT_ROOT` is pinned because the `git show` redirect on the first line runs from, and so puts +the copy in, the repository root instead of the script's nested path under that root; the +`run_tracker` call itself is unchanged, only instrumented to print the real exit status before the +accept/reject `test`. + +Command: `IMAGE_TAG=tt:repro BUILD_IMAGE=false bash -x ./instrumented-copy.sh` + +```text ++ exit_status=137 ++ echo RUN_TRACKER_STATUS=137 +RUN_TRACKER_STATUS=137 ++ test 137 -eq 0 -o 137 -eq 124 +``` + +(script exits 1; `set -e` stops at the failing `test`) + +The container log ends at `Tracker shutdown signal handlers installed.` plus health-check +requests, with no `shutting down (SIGINT)` line, as in the failing CI logs (run 43299605132). +CI's script exits 1 because of the `test` on line 39 at `ec1f58ec9` (the last `develop` commit +before PR #2857's fix merged) of +`contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh`, not because +`docker run` itself returned 1. + +### V2 - Isolate the cause + +- Status: `DONE` + +All runs below use the mounted `share/default/config/tracker.container.no-persistence.toml` +(health-check only) and the `tt:repro` image; `` is the one started by a plain +`docker run -d ...` with the same volumes, waited 4s to reach `Started on: http://...1313` +before each signal. + +| # | Command | Observed | +| --- | --- | --- | +| 1 | `docker kill --signal=INT ` | `exit=0 status=exited`; log has `shutting down (SIGINT) ...` then `successfully shutdown.` | +| 2 | `docker kill --signal=TERM ` | `exit=0 status=exited`; log has `shutting down (SIGTERM) ...` then `successfully shutdown.` | +| 3 | `kill -INT ` of a `docker run --rm ...` client running in the background | `client_exit=0`; log has `shutting down (SIGINT) ...` then `successfully shutdown.` | +| 4 | `/usr/bin/gnutimeout --signal=INT --kill-after=3s 6s docker run --rm ...` | `exit=124`; log has `shutting down (SIGINT) ...` then `successfully shutdown.` | +| 5 | `/usr/bin/gnutimeout --foreground --signal=INT --kill-after=3s 6s docker run --rm ...` | `exit=124`; log has `shutting down (SIGINT) ...` then `successfully shutdown.` | +| 6 | `timeout --signal=INT --kill-after=3s 6s docker run --rm ...` (uutils, no flag) | **`exit=137`; no `shutting down` line in the log** | +| 7 | `timeout --foreground --signal=INT --kill-after=3s 6s docker run --rm ...` (uutils) | `exit=124`; log has `shutting down (SIGINT) ...` then `successfully shutdown.` | + +Row 6 is the one case that does not shut the tracker down; it is the invocation the script used +before the fix (row 7's flag is the fix). + +Conclusion: the tracker receives and handles SIGINT and SIGTERM correctly in every case where a +signal reaches it (rows 1-5, 7); only row 6 — uutils `timeout` without `--foreground` — ends +without the tracker ever logging a shutdown. No signal-delivery probe (for example +`/proc//status` on the `docker` client under `timeout`) was recorded, so whether the SIGINT +reaches the client and is not forwarded, or never reaches the client at all, remains a hypothesis; +the fix (`--foreground`) is correct under either reading, since row 7 shows it resolves the +symptom. + +### V3 - Recheck after the fix + +- Status: `DONE` + +Ran the script with the fix from `fix(container): [#2855] stop the tracker with timeout +--foreground` (PR #2857, `timeout --foreground --signal=INT --kill-after=3s 10s ...`), against the +same `tt:repro` image, once under each `timeout`: + +```text +$ IMAGE_TAG=tt:repro BUILD_IMAGE=false bash contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh +(exit 0) +mounted-no-persistence-config-preserved-without-sqlite-artifacts +unselected-sqlite-targets-remain-unchanged-across-transitions + +$ PATH=:$PATH IMAGE_TAG=tt:repro BUILD_IMAGE=false bash contrib/dev-tools/containers/tests/test-mounted-no-persistence-configuration.sh +(exit 0) +mounted-no-persistence-config-preserved-without-sqlite-artifacts +unselected-sqlite-targets-remain-unchanged-across-transitions +``` + +The second run points the script's bare `timeout` at GNU `timeout` through a directory prepended +to `PATH` containing only a `timeout -> /usr/bin/gnutimeout` symlink, so the unmodified script +(which calls `timeout` by bare name) resolves to the GNU implementation without editing the +script. + +#### V3 rerun on the merged script + +The runs above predate PR #2857's review-fix commit, `fix(container): [#2855] address PR #2857 +review findings F2-F4,F7`, which replaced the exit-status `test` with a `case` that prints the +unexpected status and returns 1. Rerun on 2026-11-14 at 08:29 UTC on the script as merged into +`develop` at `24230dd01` (the merge of PR #2857; checked out into the working tree for the runs, +`git diff --quiet 24230dd01 --