Repository navigation
tests: attempt to fix hangs of postgres container (leads to tests timeouts) - #79360
Merged
Merged
Conversation
…eouts)
Sometimes after pause/unpause postgres does not respond the healthcheck [1]:
time="2025-04-19T21:55:59.978956920Z" level=debug msg="Calling POST /v1.46/containers/fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924/pause"
time="2025-04-19T21:55:59.984831645Z" level=debug msg="CloseMonitorChannel: waiting for probe to stop"
time="2025-04-19T21:55:59.984852523Z" level=debug msg="CloseMonitorChannel done"
time="2025-04-19T21:55:59.984890483Z" level=debug msg=event module=libcontainerd namespace=moby topic=/tasks/paused
time="2025-04-19T21:55:59.984910613Z" level=debug msg="Stop healthcheck monitoring for container fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924 (received while probing)"
time="2025-04-19T21:55:59.985084214Z" level=error msg="stream copy error: reading from a closed fifo"
time="2025-04-19T21:55:59.985264774Z" level=debug msg="Calling GET /v1.46/containers/fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924/json"
time="2025-04-19T21:55:59.985291238Z" level=error msg="stream copy error: reading from a closed fifo"
time="2025-04-19T21:55:59.985433994Z" level=debug msg="attach: stdout: end"
time="2025-04-19T21:55:59.985495990Z" level=debug msg="attach: stderr: end"
time="2025-04-19T21:55:59.985506632Z" level=debug msg="attach done"
time="2025-04-19T21:56:00.039673414Z" level=debug msg="Calling HEAD /_ping"
time="2025-04-19T21:56:00.040310748Z" level=debug msg="Calling GET /v1.46/info"
time="2025-04-19T21:56:00.054755490Z" level=debug msg="Calling GET /v1.46/containers/json?filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.oneoff%3DFalse%22%3Atrue%2C%22com.docker.compose.project%3Droottestpostgresqlreplicadatabaseengine1-gw0%22%3Atrue%2C%22com.docker.compose.service%3Dpostgres1%22%3Atrue%7D%7D"
time="2025-04-19T21:56:00.055847976Z" level=debug msg="Calling POST /v1.46/containers/fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924/unpause"
time="2025-04-19T21:56:29.976612151Z" level=warning msg="Health check for container fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924 error: timed out starting health check for container fc4c98917ee891cd27564cab1c248c66e443f1fc2e3f026b7de84762bc10e924"
[1]: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=79349&sha=4a2ce10124c6cdc507305822d28248c49c71df47&name_0=PR&name_1=Integration%20tests%20%28asan%2C%20old%20analyzer%2C%203%2F6%29
There the DROP DATABASE hanged, likely due to postgres does not respond.
Let's try autoheal
Contributor
Member
Author
|
Let's give it a try |
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Nov 23, 2026
…tgres pause Review of ClickHouse#133501 (@ PedroTadim): La Casa Del Dolor does not need the sidecar. `postgres1` has `restart: always`, and dolor stops, kills and starts it at random, so a `postgres1` that hangs is restarted by the next restart dolor picks. The sidecar only exists for the pause false positives of the integration tests (ClickHouse#79360). So dolor now stops it once after the cluster starts, when PostgreSQL is enabled, and drops the /proc walk, the drain loop and the health wait of the two previous commits. A stopped `restart: always` container stays stopped: Docker restarts it only on a daemon restart or an explicit start, and `docker compose start postgres1` starts only `postgres1`. Validated with a temporary integration test on the real docker_compose_postgres.yml, past the sidecar's 600 s start period: the control (sidecar left running) raised the CI exception `unpause postgres1 ... is not paused`, and with this line executed from dolor.py the sidecar stayed exited (RestartCount 0) through pause/unpause, stop/start and kill/start of `postgres1`, every unpause succeeded and `postgres1` was not restarted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
subkanthi
pushed a commit
to subkanthi/ClickHouse
that referenced
this pull request
Nov 23, 2026
…l Dolor paused La Casa Del Dolor (amd_debug) failed with `dolor.py exception` on unrelated PRs: `docker compose ... unpause postgres1` returned "Container ... is not paused". Docker reports a paused container that has a healthcheck as unhealthy (pausing closes its health monitor) and keeps that status after the unpause until the next probe, which runs only after `interval` (10 s for postgres1). The postgres compose file labels postgres1 `autoheal=true` and runs the willfarrell/autoheal sidecar, which restarts every labelled unhealthy container every 5 s after a 600 s start period (ClickHouse#79360). La Casa runs 15 minutes and pauses integrations since ClickHouse#131994, so a postgres pause after minute 10 is restarted by the sidecar: the restart resumes the container and the unpause fails. The dockerd debug logs of both failing runs show pause, the sidecar's `health=unhealthy` query, `restart?t=10`, then the failed unpause. When dolor pauses postgres1 it now pauses the sidecar first, and resumes it once postgres1 is healthy again. Resuming it right after the unpause is not enough, because the status is still unhealthy until the first probe. The wait is bounded at 60 s, after which the sidecar is resumed anyway, so a postgres that stays unresponsive after a pause is still healed (the reason ClickHouse#79360 added the sidecar). Not chosen: pausing with SIGSTOP (`docker kill --signal`) freezes only the postmaster, so established connections keep answering and clients see no hang, which defeats the purpose of the pause; stopping the sidecar for the whole run drops the recovery; making `unpause` tolerate a running container would hide that the pause turned into an unscheduled restart. Validated locally (no committed test: fuzzer harness change): with the current sequence `unpause` fails 5/5; with the new one 5/5 runs have no restart and no error, and postgres is healthy about 10 s after the unpause. A temporary integration test on the real compose file reproduced the CI exception after the 600 s start period and ran the new sequence 3/3 cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes after pause/unpause postgres does not respond the healthcheck 1:
There the DROP DATABASE hanged, likely due to postgres does not respond.
Let's try autoheal
Changelog category (leave one):