Repository navigation
Preserve the RabbitMQ broker log in integration tests - #114434
Conversation
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 restored bind mount degrades silently: source: ${RABBITMQ_LOGS:-} falls
back to tmpfs when the variable is unset, and every RabbitMQ module passes
either way, so losing the artifact again would be invisible. That is how the
mount was lost in the first place - 545bb5b
removed it and nothing caught that for six months.
Assert both that rabbit.log exists and that it is non-empty: a bare existence
check would accept the zero-byte file the docker logs capture already produces.
The host path comes from cluster.rabbitmq_logs_dir, which is xdist-worker
scoped, so the test is safe to run in parallel with itself. On failure it
reports the log directory's contents, which distinguishes the tmpfs regression
(empty directory) from a broker that opened the file and wrote nothing.
Internal second-model reviewTwo review rounds. Round 1 raised two majors, both fixed; round 2 raised no blocker or major. The
Verified by reading rather than accepted from the author: the new test's four control-flow states Deliberately unchanged: This change does not stop the module abort and does not explain why the Erlang node failed to register |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20260812-070002 |
|
Workflow [PR], commit [f51d629] Summary: ✅ AI ReviewSummaryThis PR restores the RabbitMQ broker log bind mount in the integration harness and adds a regression test that fails if the host-side Final Verdict✅ No blocking issues found. |
|
cc @nikitamikhaylov, could you review this? The integration harness has exported RABBITMQ_LOGS and RABBITMQ_LOGS_FS=bind and created the host directory all along, but no compose file consumed them after the bind mount was replaced with a tmpfs, so the broker's own rabbit.log is discarded on every run and a container that never starts leaves no artifact explaining why. |
|
cc @pamarcos |
CI finish ledger — f51d629CI is fully finished on this head and there are no failing checks, so there is nothing to own.
Session id: cron:our-pr-ci-monitor:20260812-180000 |
alexey-milovidov
left a comment
There was a problem hiding this comment.
This is good. Only the test for this minor CI improvement is doubtful.
fc46996
|
The test is there because this compose block was already deleted once: It costs no container time: You merged it, so I am not arguing to keep it. If you would still rather it were gone, say so and I will remove it in a follow-up. |
Related: #114415
Related: #113610
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
When a RabbitMQ container never becomes available,
wait_rabbitmq_to_startraises and every test inthe module fails from that one event. On master @
e4d3698282346fcd7e496ef668ff517106c84ac5that cost all 21 tests oftest_storage_rabbitmq/test_system_stop.pyfrom one fixture failure(report).
Four such events in 21 days, two on master.
The artifact that would say why does not survive the run.
rabbitmq.confsetslog.file = /rabbitmq_logs/rabbit.logand nolog.console, so everything goes to that file andnothing to the console, which is also why the
docker logscapture is empty./rabbitmq_logswasdeclared
tmpfs, so the log died with the container.cluster.pyhas always exportedRABBITMQ_LOGSandRABBITMQ_LOGS_FS="bind"and created the host directory, but no compose fileconsumed them after 545bb5b replaced the bind mount with tmpfs.
RabbitMQ was the only broker whose
*_LOGSexport was dead.rabbit.loghas zero hits in the failing run's whole artifact bundle.This restores the mount in the same
${VAR_FS:-tmpfs}/${VAR:-}form the siblings use, so an unsetRABBITMQ_LOGSstill degrades to tmpfs./var/lib/rabbitmqstays a tmpfs: it holds Mnesia state, andpersisting it would change test semantics.
test_system_stop.pypasses 21/21 andtest.py58/58 with the mount, each producing arabbit.logof over 100 KB under
_instances*/rabbitmq/logs/, which the integration job already tars. The newtest_rabbitmq_broker_log_is_collectedasserts that log exists and is non-empty; reverting the hunkalone leaves the rest of the module passing and reddens only that test, on an empty log directory.
This neither stops the abort nor explains why the Erlang node failed to register with epmd. #114415
recreates a hung container; this makes the next occurrence diagnosable. #113610 fixed only the second
diagnostics loop of
wait_rabbitmq_to_startand is not a container-start fix.