Repository navigation
Retry the forced kill in the integration cluster shutdown - #123638
alexey-milovidov merged 1 commit into
Conversation
`ClickHouseCluster.shutdown()` runs `docker compose stop` and falls back
to `docker compose kill` when it fails. On a loaded runner dockerd can
give up on a container that needs more than its ~14 s kill budget to
exit after SIGKILL ("tried to kill container, but did not receive an
exit event"), so `stop` fails and aborts its walk. `compose kill` then
lists that container as still running, it exits a moment later, its kill
gets "container ... is not running" and `compose kill` exits 1 although
nothing is left running. The exception escapes `shutdown()`, so a module
whose tests all passed fails at teardown, and the log scans,
`down --volumes` and `cleanup()` are skipped, leaking the project.
Retry the fallback with the existing `retry()` helper and the same
parameters as the `docker compose up` retries. Each attempt lists only
the containers that are still running, and `compose kill` succeeds when
there is none (verified with compose 2.29.7 from the CI runner image and
v5.1.3). A persistent failure still raises after the last attempt.
Seen on PR ClickHouse#120632 in `test_hive_query` (hdfs1); the same kill-fallback
shape appears 9 times in 180 days in CIDB (8 PRs and master).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261003-002600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261003-000700 |
|
Workflow [PR], commit [53fc0af] Summary: ✅ AI ReviewSummaryThis PR narrows the Final Verdict
LLVM Coverage ReportMeasured on commit 53fc0af.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +176 lines in 48 files (-109 lines lost coverage) · Details |
cd62a26
Backport #123638 to 26.9: Retry the forced kill in the integration cluster shutdown
Backport #123638 to 26.8: Retry the forced kill in the integration cluster shutdown
Related: #120632
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
ClickHouseCluster.shutdown()runsdocker compose stopand, if that fails,docker compose kill. A failure of the fallback escapesshutdown(): a module whose tests all passed is reported red at teardown, and the instance log scans,down --volumesandcleanup()are skipped, so the project leaks.Failing job:
Integration tests (amd_asan_ubsan, db disk, targeted)
on #120632
(report).
Every test of
test_hive_querypassed; the teardown error was charged to its last test. From the job'sdocker-in-docker.log:hdfs1needed about 16 s to exit after SIGKILL, more than the ~14 s dockerd waits, sostopfailed withtried to kill container, but did not receive an exit eventand leftminio1,proxy1andproxy2running.compose killstill listedhdfs1, which exited about 0.1 s before its kill arrived. That kill gotcontainer ... is not runningandcompose killexited 1, although the other three containers were killed.So the fallback fails although its goal, no running container, is reached. The same
killfailure appears 9 times in 180 days in CIDB (8 PRs and master).The change retries the
killwith the existingretry()helper, with the parameters of thedocker compose upretries. Each attempt lists only the containers still running, andcompose killexits 0 when there are none (checked with compose 2.29.7 from the runner image and with v5.1.3). A persistent failure still raises after the third attempt.Validation on
test_s3_aws_sdk_has_slightly_unreliable_behaviour(same helper containers), with a throwawaydockerwrapper injecting the CI outcome (stopfails, thenkillkills everything and exits 1): without the change1 passed, 1 errorand the project leaks; with it1 passed, the secondkillprintsNo container to killand the project is removed. Akillthat always fails still errors after 3 attempts. Uninjected runs pass 3/3.Workflow [PR]
Sync PR [sync-upstream/pr/123638]
Version info
26.10.1.1427-master(included in26.10and later)26.9.34.22,26.8.42.20