Repository navigation
Recreate a hung RabbitMQ container in integration test setup instead of failing the whole module - #114415
Conversation
The RabbitMQ container occasionally hangs on startup in CI: the entrypoint produces no output at all, the Erlang node never registers with epmd, and `rabbitmqctl await_startup` keeps failing for the whole 120 seconds - while a parallel worker's container on the same host starts in 3 seconds. When that happens, every test in the module fails with `Cannot wait RabbitMQ container`. This has been striking roughly weekly since at least 2026-06-16, almost always in `arm_binary` integration jobs. Make `wait_rabbitmq_to_start` collect diagnostics, recreate the container and wait once more before giving up. Also, `rabbitmq_debuginfo` used to discard all of its output (piped to stdout and never read); route it through `run_and_check` so it lands in the test log, and add the container state and the in-container process list so a future hang shows where the entrypoint is stuck. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=e4d3698282346fcd7e496ef668ff517106c84ac5&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [27ebf5a] Summary: ✅ AI ReviewSummaryThis PR changes Final Verdict✅ No blocking findings. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
alexey-milovidov
left a comment
There was a problem hiding this comment.
It's funny how we are still fixing RabbitMQ after five years.
When a RabbitMQ container fails to become available, wait_rabbitmq_to_start raises and every test in the affected module fails from that one event. The broker's own log, the artifact that would say why the node never started, does not survive the run. rabbitmq.conf sets log.file = /rabbitmq_logs/rabbit.log and no log.console, so everything the broker logs goes to that file and nothing to the console, which is also why the docker logs capture produces an empty file. The compose file declares /rabbitmq_logs as tmpfs, so the log dies with the container. cluster.py has always exported RABBITMQ_LOGS and RABBITMQ_LOGS_FS="bind" and created the host directory, but no compose file consumed them after 545bb5b replaced the bind mount with a tmpfs entry. RabbitMQ was the only broker whose *_LOGS export was dead. Restore the mount in the same ${VAR_FS:-tmpfs} / ${VAR:-} form the live sibling compose files use, so an unset RABBITMQ_LOGS still degrades to tmpfs. /var/lib/rabbitmq stays a tmpfs: it holds Mnesia state, and persisting it across runs would change test semantics. The log lands in _instances*/rabbitmq/logs/, which the integration job already tars. This neither stops the module abort nor explains why the Erlang node failed to register with epmd. ClickHouse#114415 recreates a hung container; this makes the next occurrence diagnosable. ClickHouse#113610 fixed only the second diagnostics loop of wait_rabbitmq_to_start and is not a container-start fix.
The RabbitMQ container occasionally hangs on startup in integration tests: the entrypoint produces no output at all, the Erlang node never registers with epmd, and
rabbitmqctl await_startupkeeps failing for the whole 120 seconds — while a parallel worker's container on the same host starts in 3 seconds. When that happens, every test in the affected module fails withCannot wait RabbitMQ container. This has been striking roughly weekly since at least 2026-06-16, almost always inarm_binaryintegration jobs, most recently on master: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=e4d3698282346fcd7e496ef668ff517106c84ac5&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29 (21 tests oftest_storage_rabbitmq/test_system_stop.py, whiletest.pyin the same run passed all 57 tests with the same image). The host was nearly idle during the hang, so this is not resource starvation.This change makes
wait_rabbitmq_to_startcollect diagnostics, force-remove the hung container, bring up a fresh one and wait once more before giving up — the same recoveryreset_rabbitmqalready uses. Additionally,rabbitmq_debuginfoused to pipe all of its diagnostics output intosubprocess.PIPEand never read it, so the failure path collected nothing; it now routes output throughrun_and_check(which logs it) and also dumps the container state (including the OOM-killed flag) and the in-container process list, so a future hang shows exactly where the entrypoint is stuck.The behavior is pinned by
tests/integration/test_cluster_waiters/test_rabbitmq_start_retry.py(rewritten fromtest_rabbitmq_diagnostics_once.py, which pinned the structure of the code this change replaces): one set of diagnostics per attempt, one recreation between attempts, recovery when the fresh container comes up, and no effect on the healthy path.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Version info
26.8.1.1251(included in26.8and later)