Skip to content

Report a crashed server as Server died in functional tests - #124032

Merged
leshikus merged 3 commits into
ClickHouse:masterfrom
groeneai:fix-hung-check-dead-server-verdict
Nov 20, 2026
Merged

leshikus merged 3 commits into
ClickHouse:masterfrom
groeneai:fix-hung-check-dead-server-verdict

Conversation

@groeneai

@groeneai groeneai commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #119389

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):

...

Description

Fast test on #119389 @ 80040fd0 (report) shows one failing row, Server liveness check failed, and Failed: 0. The server had died: its clickhouse-server.err.log has <Fatal> BaseDaemon: ... Received signal 11 in SerializationDynamic::serializeTextJSON. In 30 days 59 Fast test runs on 20 PRs ended with this row, none showing the crash; all 5 with readable artifacts were real crashes.

Two gaps:

  • tests/clickhouse-test: probed_server_process tells a gone listener (dead process) from a held one (alive but silent) and from "cannot tell", but HungCheckMonitor.is_hung and the worker-side probed_server_is_gone reduced that to a bool, so every stop on a failed probe claimed HUNG_CHECK_EXIT_CODE. Now a failed probe with the listener gone or replaced claims STOP_TESTING_EXIT_CODE / SERVER_DIED (row Server died), and a parallel worker that sees it leaves the stop to the parent like the liveness branch (its stop_tests() SIGTERMed the parent: exit 143). A listener still held past the grace, or an unknown state (no /proc, a remote server), keeps Server liveness check failed. Probe timing, retries and grace are unchanged.
  • ci/jobs/fast_test.py never scanned the server logs. On an aborted run it now appends the failing rows of check_fatal_messages_in_logs(), like the stateless job, e.g. Segmentation fault (STID: 3887-3f80) with its stack trace.

Validated with throwaway drivers (not committed): a test that SIGKILLs its own server gives exit 5 and Server liveness check failed on master, exit 2 and Server died here, whether the parent or a worker detects it; a SIGSTOPped server (alive, silent) still gives Server liveness check failed; the fast_test.py block on the 80040fd server logs adds exactly that Segmentation fault row, and nothing without a crash.

Not covered (as on master): a server that dies in the last sequential test still ends as clickhouse-test exit code 1; no Fast test run hit it in 90 days.


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

Version info

  • Merged into: 26.12.1.44-master (included in 26.12 and later)

A functional-test run whose server crashed was reported as `Server
liveness check failed`, a leaf that reads like a harness flake, and Fast
test did not show the crash at all (e.g. PR ClickHouse#119389 @ 80040fd: a
SIGSEGV in `SerializationDynamic::serializeTextJSON` showed up as one
liveness row with 0 failed tests).

`probed_server_process` already tells a gone listener (nothing listens on
the probed port: the process is dead) from a held one (alive but silent)
and from "cannot tell", but `HungCheckMonitor.is_hung` and
`probed_server_is_gone` collapsed that into a bool, so every failed probe
claimed `HUNG_CHECK_EXIT_CODE`. Now a failed probe with the listener gone
or replaced claims `STOP_TESTING_EXIT_CODE` / `FailureReason.SERVER_DIED`
(leaf `Server died`); a held listener past the grace and the cannot-tell
case keep `HUNG_CHECK_EXIT_CODE` (leaf `Server liveness check failed`).
Probe timing, retries and the grace are unchanged.

`fast_test.py` now appends the failing rows of
`check_fatal_messages_in_logs()` when the run was aborted, as the
stateless job does in its error-check stage, so the crash is a row of the
report (e.g. `Segmentation fault (STID: ...)` with the stack trace).

Related: ClickHouse#119389
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Oct 5, 2026
@groeneai

groeneai commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: claude; 1 finding) plus my own cold review (2 findings).

# Sev Finding Verdict Evidence / action
1 💡 No committed test covers the new verdict split or the fast_test.py crash rows AGREE Closed by the throwaway runs in the description (SIGKILL: exit 5 on master vs exit 2 / Server died; SIGSTOP keeps Server liveness check failed; the 80040fd logs give one Segmentation fault row). ci/tests no longer exists.
2 💡 HungCheckMonitor docstring: "Not being able to tell ... reads as gone" now reads ambiguously next to server_gone AGREE Not blocking: still true for the abort decision, which is unchanged.
3 💡 "every failed probe claimed HUNG_CHECK_EXIT_CODE" is imprecise (a probe inside the grace claims nothing) AGREE Description reworded.

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-10:20261005-133100

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Oct 5, 2026
@groeneai
groeneai requested a review from leshikus October 5, 2026 14:10
@clickhouse-gh

clickhouse-gh Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [12f1276]

Summary: ✅


AI Review

Summary

Distinguishes confirmed listener loss from failed liveness probes, preserves coordinated shutdown in parallel workers, and adds fatal-log diagnostics to aborted Fast test reports. The prior worker shutdown finding is fixed. Focused checks passed for listener transitions, worker-first and sequential exit code 2, and fatal-row aggregation. No actionable findings remain.

Final Verdict

Status: ✅ Approve.

Comment thread ci/jobs/fast_test.py Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 5, 2026
…-server-verdict

Resolve the conflict in ci/jobs/fast_test.py: keep master's
`Targeting` import and `fail_slow_new_tests` call next to this PR's
`ABORTED_RUN_EXIT_CODES` import and crash-row block. The two only touch
different result rows (`fail_slow_new_tests` checks `OK` rows of new
tests; the crash rows are failures), so their order does not matter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread tests/clickhouse-test Resolved
The `SERVER_DIED` branch of `run_tests_array` called `stop_tests()` in
parallel workers too. Its `killpg` sends SIGTERM to the whole group,
including the parent, which then exited 143 (`Terminated`) instead of
`STOP_TESTING_EXIT_CODE`. The liveness, max-failures and time-limit
branches already skip it in parallel workers and let the parent stop
the workers with SIGTERM masked.

This branch is now also reached when a worker's probe finds the
listener gone, which before this PR went through the liveness branch.
With a test that SIGKILLs its server and no --hung-check (one worker),
the runner exits 143 without this change and 2 with it, the leaf is
`Server died` in both cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-testing Test content only (no production code). and removed comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 19, 2026

@leshikus leshikus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@leshikus
leshikus added this pull request to the merge queue Nov 20, 2026
Merged via the queue into ClickHouse:master with commit a5b4d1a Nov 20, 2026
191 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI 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.

3 participants