Repository navigation
Conversation
The test sends malformed Hello packets to the proxy TCP port and expects
the server to reject them with "client_name does not match" and
"version does not match".
When validate_tcp_client_information is on (set in the CI test config),
the server rejects the malformed Query packet during parsing, before a
query context exists. Per TCPHandler.cpp it sends the exception and then
closes the connection, because it consumed only part of the packet and
the trailing client bytes would be misinterpreted as the next packet.
The client (printf) has already written those trailing bytes, which the
server never reads, so the close produces a TCP RST. The RST can race
ahead of nc reading the buffered exception, so a single attempt
occasionally yields no output. With no pipefail/set -e in the test, the
script exit code is then the last grep's exit (1, no match) and the
expected line is missing, which is exactly the observed CI failure
("return code: 1" with the expected output otherwise produced; 104/104
re-runs with the same randomized settings passed).
Wrap each probe in a bounded retry loop that re-sends until the expected
rejection message appears. A genuine breakage still fails: every attempt
yields empty output and the diff against the reference does not match.
The reference file and the assertions are unchanged.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-2:20260610-184028 |
|
cc @CheSema — could you review this test-only fix? It makes |
|
Workflow [PR], commit [765e3e5] Summary: ❌
AI ReviewSummaryThis PR keeps Missing context / blind spots
Final VerdictStatus: ✅ Approve Pending CI should still complete before merge. |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 644 line(s), 53 function(s) across 147 file(s) · Details Top files
|
|
CI fully finished (Finish Workflow passed). Failures, both pre-existing chronic classes, none PR-caused (this PR fixes flaky 02865_tcp_proxy_query_packet_validation):
|
381eea2
…ted queries) and ClickHouse#107056 The prior CI run executed on a merge-base ~980 commits behind these fixes, so it inherited the master-wide ASan heap corruption from ClickHouse#106020 (segfaults during String serialization in DistributedSink / MergeTask / MergeMutate, STIDs 1288-3bd5, 2046-50c3, 0988-1d81) plus the known-flaky 02865_tcp_proxy_query_packet_validation. Both are fixed on current master. No conflicts; CREATE OR REPLACE size-check changes are unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ted queries) and ClickHouse#107056 The prior CI run executed on a merge-base ~980 commits behind these fixes, so it inherited the master-wide ASan heap corruption from ClickHouse#106020 (segfaults during String serialization in DistributedSink / MergeTask / MergeMutate, STIDs 1288-3bd5, 2046-50c3, 0988-1d81) plus the known-flaky 02865_tcp_proxy_query_packet_validation. Both are fixed on current master. No conflicts; CREATE OR REPLACE size-check changes are unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes a rare flaky failure of
02865_tcp_proxy_query_packet_validation, reported by @ alexey-milovidov on #106222 ("return code: 1" while the expected output was otherwise produced; 104/104 re-runs with the same randomized settings passed). The failure is unrelated to that PR.Root cause: the test sends malformed Hello packets to the proxy TCP port and expects the server to reject them. When
validate_tcp_client_informationis on (set in the CI test config), the server rejects the malformed Query packet during parsing, before a query context exists. PerTCPHandler.cppit sends the exception and then closes the connection, because it consumed only part of the packet and the trailing client bytes would be misinterpreted as the next packet. The client (printf) has already written those trailing bytes, which the server never reads, so the close produces a TCP RST. The RST can race ahead ofncreading the buffered exception, so a single attempt occasionally yields no output, and the lastgrepthen exits 1 with the expected line missing.Fix: wrap each probe in a bounded retry loop that re-sends until the expected rejection message appears. A genuine breakage still fails, because every attempt yields empty output and the diff against the reference does not match. The reference file and the assertions are unchanged; the fix is in the test only.
Version info
26.6.1.648