Repository navigation
Conversation
The test SIGKILLs clickhouse-client processes mid-insert (thread_cancel). Under LLVM coverage instrumentation each client writes to a shared profraw merge pool on exit; killing one mid-write corrupts the pool, and surviving instrumented clients then print "LLVM Profile Error:" lines to stderr. insert_data folds client stderr into stdout via 2>&1, so those error lines land in the captured .stdout that is diffed against .reference, producing a false "result differs with reference". The three expected values (500000/500000/1) are always present and correct - only the LLVM runtime noise diverges. The runner already strips these lines from its own stderr capture (PR ClickHouse#97020) but not from the test's merged stdout. This recurs once per weekly NightlyCoverage run (7 master hits in 30 days, all on amd_llvm_coverage_per_test, zero on any other build). Coverage data collected from a process that is killed mid-merge is invalid by definition, so the test should not run there - same rationale as the existing no-asan/no-msan/no-tsan/no-debug exclusions. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260629-215600 |
|
cc @CheSema — could you review this one-line test tag change? Adds |
|
Workflow [PR], commit [74dc65c] Summary: ✅ AI ReviewSummaryThis PR adds Findings
Final VerdictStatus: Minimum required actions:
|
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 92 line(s), 1 function(s) across 39 file(s) · Details Top files
|
CI finish ledger — 7a3ac9dEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
Mergeable Check / PR are the aggregator jobs reflecting the three chronic Stress hung-check reds above; no separate owner. Session id: cron:our-pr-ci-monitor:20260630-033000 |
| # Tags: no-random-settings, no-asan, no-msan, no-tsan, no-async-insert, no-debug, no-fasttest, no-replicated-database | ||
| # Tags: no-random-settings, no-asan, no-msan, no-tsan, no-async-insert, no-debug, no-fasttest, no-replicated-database, no-llvm-coverage | ||
| # no-fasttest: The test runs for 40 seconds | ||
| # no-llvm-coverage: thread_cancel SIGKILLs instrumented clients mid-write, corrupting the shared |
There was a problem hiding this comment.
Why is the distributed sibling left under llvm_coverage? The rationale in this comment still applies to tests/queries/0_stateless/04365_cancel_insert_when_client_dies_distributed.sh: its insert_data path uses only CLICKHOUSE_CLIENT (tests/queries/0_stateless/04365_cancel_insert_when_client_dies_distributed.sh:25-30), thread_cancel still randomly sends SIGKILL, and thread_insert still folds stderr into the compared output with 2>&1 | grep -Fav "Killed" (tests/queries/0_stateless/04365_cancel_insert_when_client_dies_distributed.sh:45). That means a killed client can still corrupt the shared profraw merge pool and a later client can still leak LLVM Profile Error: into the golden output, so this PR can just move the recurring coverage-only red from 02434 to 04365. Please either tag that sibling no-llvm-coverage too or explain what makes it immune.
There was a problem hiding this comment.
You are right that 04365 is not immune, and the verification made me conclude this PR is the wrong fix for the problem, so I am closing it in favour of #110716.
04365 on master has no no-llvm-coverage tag (line 2), inserts through the native $CLICKHOUSE_CLIENT (line 29), still does kill -s "$SIGNAL" with KILL (line 71), and still merges client stderr into the compared output at line 45. CIDB confirms it empirically rather than only structurally: 18 master failures in the last 45 days, all 18 carrying LLVM Profile Error: in the diff. Your prediction that tagging only 02434 moves the recurring red to 04365 is already observed reality.
Where I disagree is the remedy, and it applies to this PR too. The tag skips the test, but the test is not failing. In the last master failure (sha a8c156e623333d40936998a3b0d273966835912c, 2026-07-27 03:59) the captured stdout contains all three expected values, 500000 / 500000 / 1, present and correct; the only divergence is injected profiler lines. The cancellation path works fine under coverage, so skipping it discards a passing test.
clickhouse-test already treats this class as noise to filter rather than a reason to skip: lines 3135-3145 strip LLVM Profile Error: from stderr, with a comment citing #97020 and stating the test output is correct. These tests fail only because thread_insert folds client stderr into stdout with 2>&1 before the runner's filter can see it. The corrupted pool also belongs to clickhouse-client-* processes, whereas per-test coverage of the server is collected server side into system.coverage_log (lines 5704-5723) and survives a killed client, so the tag would trade real server coverage of the cancellation and deduplication path for suppressing a client-side output artifact.
#110716 applies that filter to all four carriers, 02434, 02435, 04365 and 04366, and leaves every one of them running under coverage. Its 04365 hunk is what you are asking for here, by the mechanism the runner already uses. I verified it by extracting each revision's committed filter chain and running it against the real captured stdout above: master differs from the reference, the #110716 chain matches it byte for byte, a genuine Code: 341. DB::Exception still survives the filter, and removing just the new filter breaks it again.
|
Closing this in favour of #110716, which fixes the same failure by a better mechanism. The recurring red here is not a test-logic failure. In the last master occurrence (sha So the right fix is to filter the noise and keep running the test, not to tag the test out of coverage. Skipping it also loses real coverage: the corrupted profraw files belong to #110716 adds that one filter to all four affected tests, |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Disable
02434_cancel_insert_when_client_diesunder LLVM coverage (no-llvm-coveragetag).No related open issue found (historical #67599 is closed).
Failure: recurring red check on master,
Stateless tests (amd_llvm_coverage_per_test, per_test_coverage, 6/8)— 7 hits in the last 30 days, exactly one per weekly NightlyCoverage run (06-01, 06-04, 06-08, 06-11, 06-15, 06-21, 06-27), and zero failures on any non-coverage build.Reason: result differs with reference.Root cause (not a result/count divergence): the diff in every failure shows all three expected values present and correct — the only divergence is
LLVM Profile Error:lines injected between them:thread_cancelSIGINT/SIGKILLsclickhouse-clientprocesses mid-insert (the whole point of the test). Under LLVM coverage instrumentation each client writes to a shared profraw merge pool on exit; killing one mid-write corrupts the pool, and surviving instrumented clients then printLLVM Profile Error:to stderr.insert_datafolds client stderr into stdout via2>&1, so those lines land in the captured.stdoutdiffed against.reference. The runner already stripsLLVM Profile Error:from its own stderr capture (#97020) but not from the test's merged stdout.Fix: add
no-llvm-coverage. Coverage data collected from a process killed mid-merge is invalid by construction, so the test should not run under coverage — the same rationale as the existingno-asan/no-msan/no-tsan/no-debugexclusions. The test runs unchanged on every other build, fully preserving its ability to verify cancellation.Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=b3461b9116ed78b84a6c37fa846134523a46e21f&name_0=NightlyCoverage&name_1=Stateless%20tests%20%28amd_llvm_coverage_per_test%2C%20per_test_coverage%2C%206%2F8%29