Skip to content

Restart the azurite emulator when it crashes, and report process crashes from dmesg - #119808

Merged
alexey-milovidov merged 2 commits into
masterfrom
azurite-crash-recovery
Sep 13, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
azurite-crash-recovery

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Integration tests (amd_msan, 8/8) in MasterCI for 11f0dc83 failed 13 test_storage_iceberg_with_spark Azure tests in a row, all of them with Connection refused on the blob port, or Timeout: connect timed out when the connection came from the server instead of the harness:

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=11f0dc839f845a3b866eddfd16360061f8bdeb2c&name_0=MasterCI&name_1=Integration%20tests%20%28amd_msan%2C%208%2F8%29

The Azure Blob Storage emulator had died. The job's dmesg records

traps: node[97065] general protection fault ip:7fa9ef269c92 sp:7fa9ed698850 error:0 in ld-musl-x86_64.so.1[7fa9ef238000+57000]

at 05:18:33, and the Docker daemon's log shows the container's task exiting in the same second and its port mapping's iptables rules being deleted 18 ms later. clickhouse/azure-storage-azurite:3.35.0 is a mirror of mcr.microsoft.com/azure-storage/azurite:3.35.0, which is built FROM node:22-alpine — Node on musl, a combination that aborts like this now and then.

The service had no restart policy, so the container stayed exited for the next 21 minutes, until the session-scoped cluster was torn down and started again. Every Azure test scheduled onto that worker in between failed the same way.

Two changes:

  • azurite1 gets restart: always, which keeps a crash to the test that hit it. The blob data and the emulator's metadata live in the container's own filesystem (the command drops the image's -l /data, so the location is the /opt/azurite workdir), which a restart of the same container preserves, and Docker re-programs the port mapping. This is what every other support service in compose/ already does — mysql, mongo, postgres, keeper, redis, hdfs, hive, nginx, coredns and the rest. wait_azurite_to_start polls the blob endpoint for 180 seconds and never looks at the container, so a crash loop at startup times out exactly as it did before.
  • The integration test job now prints the kernel's process-fault lines next to the memory-kill lines print_oom_lines already prints, on the same two triggers and with the same caveats. Nothing in the report mentioned a crash at all: the harness sees only Connection refused, and the emulator's own log had already been overwritten by the next cluster started in the same instance directory, so diagnosing this meant downloading the dmesg artifact and reading it by hand. The lines are printed rather than turned into a result row, and are not filtered by which process faulted — some tests kill a server on purpose, and the kernel names the process but not the container, so no row here could be attributed to the run's outcome. show_signal: is matched along with the faults because it carries printk's rate-limit count; for this run it says 28 callbacks suppressed, so silence under it is not evidence that nothing else crashed.

Verified locally by killing the emulator's process from the host (an abnormal exit, not a Docker stop): the port stops listening with Connection refused, Docker restarts the container, the port mapping comes back and a blob uploaded before the kill is still readable afterwards. The new dmesg scan, run against this job's actual dmesg-follow.log, prints both the fault line and the rate-limit line above.

The emulator crash itself is not fixed here — it is in a third-party image — and had no tracking issue, so one is filed.

Related: #119807

Changelog category (leave one):

  • CI Fix or Improvement

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/119808]

Version info

  • Merged into: 26.9.1.1423 (included in 26.9 and later)

alexey-milovidov and others added 2 commits September 13, 2026 16:21
`Integration tests (amd_msan, 8/8)` in `MasterCI` for `11f0dc83` failed 13
`test_storage_iceberg_with_spark` Azure tests in a row, all with
`Connection refused` on the blob port, or `Timeout: connect timed out` when
the connection came from the server instead of the harness.

The emulator had died. The host's dmesg records

    traps: node[97065] general protection fault ip:7fa9ef269c92 sp:7fa9ed698850 \
    error:0 in ld-musl-x86_64.so.1[7fa9ef238000+57000]

at 05:18:33, and the Docker daemon's log shows the container's task exiting at
the same instant, followed by the port mapping's `iptables` rules being
deleted. `clickhouse/azure-storage-azurite:3.35.0` is a mirror of
`mcr.microsoft.com/azure-storage/azurite:3.35.0`, which is `node:22-alpine` -
Node on musl, a combination that aborts like this now and then.

With no restart policy the container stayed exited for the next 21 minutes,
until the session-scoped cluster was torn down and started again, so every
Azure test scheduled onto that worker in between failed the same way. A
restart keeps the crash to the test that hit it: the blob data and the
emulator's metadata live in the container's own filesystem, which a restart
of the same container preserves, and Docker re-programs the port mapping.
This matches every other support service in `compose/` - `mysql`, `mongo`,
`postgres`, `keeper`, `redis`, `hdfs`, `hive`, `nginx` and `coredns` all set
it already.

`wait_azurite_to_start` polls the blob endpoint for 180 seconds and never
looks at the container, so a crash loop at startup times out exactly as it
did before.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=11f0dc839f845a3b866eddfd16360061f8bdeb2c&name_0=MasterCI&name_1=Integration%20tests%20%28amd_msan%2C%208%2F8%29

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diagnosing the `azurite` crash above meant downloading the job's `dmesg`
artifact and reading it by hand, because nothing in the report mentioned a
crash at all - the harness only sees `Connection refused`, and the support
container's own log had already been overwritten by the next cluster started
in the same instance directory.

Print the kernel's process-fault lines next to the memory-kill lines that
`print_oom_lines` already prints, on the same two triggers (a failing run and
a hard timeout) and with the same caveats about what a buffer that was not
cleared, or does not span the run, can establish.

Printed rather than turned into a result row, and not filtered by which
process faulted: some tests kill a server on purpose, and the kernel names
the process but not the container, so no row here could be attributed to the
run's outcome.

`show_signal:` is matched along with the fault lines themselves because it
carries printk's rate-limit count - the report for `11f0dc83` says
`show_signal: 28 callbacks suppressed`, so silence under it is not evidence
that nothing else crashed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d048373]

Summary: ✅


AI Review

Summary

Adds restart: always to the Azurite support container used by integration tests and extends integration_test_job.py to print kernel process-fault lines from dmesg next to the existing OOM diagnostics. I did not find a current correctness, lifecycle, or evidence gap that warrants changes.

Final Verdict

Status: ✅ Approve

LLVM Coverage Report

Measured on commit d048373.

Metric Baseline Current Δ
Lines 89.00% 89.00% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.40% 81.40% +0.00%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +144 lines in 45 files (-149 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Sep 13, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Sep 13, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 13, 2026
Merged via the queue into master with commit 37a028d Sep 13, 2026
176 checks passed
@alexey-milovidov
alexey-milovidov deleted the azurite-crash-recovery branch September 13, 2026 21:04
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants