Repository navigation
Do not symbolize stack traces in two native-protocol tests that discard them - #121512
Conversation
…rd them 02010_lc_native and 04616_replicated_serialization_oob_index_native_protocol speak the native TCP protocol by hand and send deliberately malformed blocks to assert on the exception the server returns. Three of 02010's four exchanges and all five of 04616's wait for such a rejection. Detecting the malformation is trivial, but before the server can answer it materializes a 21-frame symbolized text stack trace, and each test's readException reads that field and throws it away. Neither .reference contains a trace. On amd_llvm_coverage the symbol lookups cost 9.2 to 16.1 s per exchange, against the s.settimeout(30) these tests use as a hang guard: across 34 public jobs, 102 of 136 exchanges exceed 10 s and the worst is 16.11 s, a 1.86x margin. The one 02010 exchange that expects no exception takes 0.09 to 0.15 s on the same jobs, so the cost is the trace and not the insert. Each test now sends calculate_text_stack_trace = 0 in the per-query settings field of the protocol, one site per file, in the name/is_important/value format 02750_settings_alias_tcp_protocol.python uses at the same revision. It has to travel there rather than in an inline SETTINGS clause: TCPHandler snapshots send_exception_with_stack_trace in extractConnectionSettingsFromContext before it calls executeQuery, which is where an inline clause would be applied. That snapshot feeds the four sendException call sites and the LOG_INFO/LOG_ERROR pair, while executeQuery separately gates getExceptionStackTraceString on the same setting, and Exception::getStackTraceString() re-materializes on each call. So disabling only the executeQuery path would move the cost to sendException while the server log lost its Stack trace marker. is_important = 1 makes a future rename of the setting a loud failure rather than a silent revert to symbolizing. Every settimeout(30) is left untouched, so the hang guard still bounds an unresponsive server. Verified: both tests raise TimeoutError in readStrict at 30 s against a listener that accepts and never answers; the wire trace measures 0 bytes fixed against 3886 to 4560 bytes on base; the Stack trace log marker disappears from all eight exception exchanges; stdout stays byte-identical to .reference; and 50 of 50 randomized runs pass for each test. Deriving the socket deadline from CLICKHOUSE_TEST_TIMEOUT was considered and rejected: it widens the tolerance for a cost nobody consumes instead of removing it. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; two full passes over this tree, 3 findings).
Severity: ❌ blocker / The other raw-socket Session id: cron:clickhouse-review-slot-10:20260922-070106 |
|
Workflow [PR], commit [e803438] Summary: ✅ AI ReviewSummaryThis PR updates two raw native-protocol stateless tests to send Final Verdict✅ No blocking findings. |
|
@Avogar you can give a look. The PR is very small |
ebb00cc
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Two raw-socket native-protocol tests now ask the server not to build a text stack trace they immediately discard.
Description
02010_lc_nativeand04616_replicated_serialization_oob_index_native_protocolspeak the native TCPprotocol by hand and assert on the exception the server returns for a deliberately malformed block:
three of
02010's four exchanges, and all five of04616's.Detecting the malformation is trivial, but before answering the server materializes a text stack trace
that
readExceptionreads and throws away; neither.referencecontains a trace. Onamd_llvm_coveragethose symbol lookups cost 9.2 to 16.1 s per exchange against thes.settimeout(30)hang guard: across 34 public jobs, 102 of 136 exchanges exceed 10 s, worst 16.11 s,a 1.86x margin. In
Stateless tests (amd_llvm_coverage, 1/3)on master07f2c401,02010's three exception exchanges take 11.59, 11.83 and 12.11 s of the 37.3 s that job records for thewhole test, while its one exchange expecting no exception takes 0.09 s: the cost is the trace, not the
insert.
Each test now sends
calculate_text_stack_trace = 0in the protocol's per-query settings field, onesite per file. It has to travel there, not in an inline
SETTINGSclause:TCPHandlersnapshots thisflag in
extractConnectionSettingsFromContext, beforeexecuteQueryapplies an inline clause, so sucha clause reaches the logging path but not the one answering the client. Every
settimeout(30)isuntouched: the guard stays, with far more margin than the work that remains. Both tests assert on the
exception code and message, which do not change, so a regression still fails visibly, and
00921_datetime64_compatibility_long.shalready makes the same trade.This signature has never failed publicly, 0 occurrences in 365 days: the claim is pointless work on
every run and a thin margin, not frequency. Deriving the deadline from
CLICKHOUSE_TEST_TIMEOUTinstead would widen tolerance for a cost nobody consumes.
02010's valid-insert exchange involves notrace, so this does not help it.
No related open issue found.
Workflow [PR]
Sync PR [sync-upstream/pr/121512]
Version info
26.10.1.477-master(included in26.10and later)