Skip to content

Fix flaky Run server init.d install check on 25.8 (backport of #106056) - #108987

Merged
alexey-milovidov merged 1 commit into
25.8from
fix-initd-test-retry-25.8
Jun 30, 2026
Merged

alexey-milovidov merged 1 commit into
25.8from
fix-initd-test-retry-25.8

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

The Run server init.d test in the Install packages job flakes on the 25.8 release branch: the server reports Server started via the init.d wrapper, but clickhouse-client -q 'SELECT version()' then fails with Code: 210. DB::NetException: Connection refused (localhost:9000).

The initd_test script in ci/jobs/install_check.py on 25.8 runs SELECT version() exactly once, immediately after the wrapper prints Server started. The wrapper only checks that the pid file exists, but on a slow CI host (notably the amd_debug build) the server takes several more seconds to open the TCP listener. In the very same job the sibling binary_test already retries SELECT version() and, on 25.8 backport runs, routinely needs ~4 seconds before the debug server accepts connections — while initd_test gives up after the first attempt.

This is the same failure mode as #86278, fixed on master by #106056 ("Extend Run server init.d retry budget from 5s to 30s"). That fix never reached 25.8, so the flake keeps blocking 25.8 backport PRs (for example #108965 and #108917). Because the 25.8 initd_test predates the retry loop entirely, #106056 does not cherry-pick cleanly; this PR adapts the same fix by adding a 30-iteration poll loop that breaks early on success, matching the existing binary_test and keeper_test patterns. SYSTEMCTL_SKIP_REDIRECT is intentionally not added, since the 25.8 init.d script does not support it.

Related issue: #86278
Backport of: #106056

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

🤖 Generated with Claude Code

The `initd_test` script in `ci/jobs/install_check.py` on `25.8` runs
`clickhouse-client -q 'SELECT version()'` exactly once, immediately after
the init.d wrapper prints `Server started`. The wrapper only checks that
the pid file exists, but on a slow CI host (notably the `amd_debug` build)
the server can take several seconds longer to open the TCP listener on
port 9000. The test then fails with
`Code: 210. DB::NetException: Connection refused (localhost:9000)`.

In the same job the sibling `binary_test` already retries `SELECT version()`
in a loop, and on `25.8` backport runs it routinely takes ~4 seconds (4
retries) before the debug server accepts connections, while `initd_test`
gives up after the first attempt.

This is the same failure mode as #86278, which was fixed on `master` by
#106056 ("Extend `Run server init.d` retry budget from 5s to 30s"). That
fix never reached `25.8`, so the flake keeps blocking `25.8` backport PRs
(for example #108965 and #108917). Because the `25.8` `initd_test` predates
the retry loop entirely, #106056 does not cherry-pick cleanly; this commit
adapts the same fix by adding a 30-iteration poll loop that breaks early on
success, matching the existing `binary_test` and `keeper_test` patterns.

`SYSTEMCTL_SKIP_REDIRECT` is intentionally not added, since the `25.8`
init.d script does not support it.

Related: #86278, #106056

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

clickhouse-gh Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [12ebc55]

@alexey-milovidov
alexey-milovidov merged commit 23aaef3 into 25.8 Jun 30, 2026
33 checks passed
@alexey-milovidov alexey-milovidov self-assigned this Jun 30, 2026
@alexey-milovidov
alexey-milovidov deleted the fix-initd-test-retry-25.8 branch June 30, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant