Repository navigation
Do not swallow fatal errors (e.g. MEMORY_LIMIT_EXCEEDED) in tryDeserialize - #106808
Conversation
|
Workflow [PR], commit [692bc78] Summary: ❌
AI ReviewSummaryThis PR moves recoverable parse-error classification into PR Metadata
ClickHouse now propagates fatal input-parsing errors such as `MEMORY_LIMIT_EXCEEDED` instead of silently replacing values with defaults or skipping rows when best-effort input parsing is enabled.Findings💡 Nits
Final VerdictStatus: ✅ Approve |
|
Something that exists in master as well Update, so far no clue - https://pastila.nl/?01a01dd7/4913928751b1184f60d73ad9a65ef1bb#DXb82TPkOZnLgYx6OKQPAw==GCM Table came from tests/queries/0_stateless/02346_text_index_lwd.sql UPD: #106867 |
a56622a to
4fb11e3
Compare
4fb11e3 to
1879729
Compare
…alize The serialization "try-pattern" (`tryDeserializeText`/`tryRead` and the restore-on-failure paths) catches every exception and returns `false`, i.e. treats the value as "did not parse". That is correct for genuine parse errors, but it also swallows fatal errors such as `MEMORY_LIMIT_EXCEEDED` (and query cancellation, logical errors, ...): during best-effort parsing (`input_format_null_as_default`, `input_format_allow_errors_num`/`ratio`, schema inference) such an error is silently turned into a default / skipped row instead of aborting the query. Make the try-pattern distinguish the two: - Move `isParseError` out of `Processors/Formats/IRowInputFormat` into a shared `Formats/ParseError.h` so the serialization layer (which is below Processors) can use it; add `rethrowIfNotParseError`, which rethrows the currently handled exception unless it is a parse error. - Call it from every `tryDeserialize` `catch (...)` site: the generic `SimpleTextSerialization` base and the `ISerialization` helper, the leaf `String`/`FixedString`/`CustomSimpleText` patterns, and the composite restores (`SerializationTuple::addElementSafe`, `Array`, `Map`, `Nullable`, `QBit`). Now only a genuine parse error is reported as a not-parsed value; every other error propagates. The set of parse errors is the same allowlist `IRowInputFormat` already used to decide which rows may be skipped, so the row-input error-skipping behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Regression test for the contract that the tryDeserialize "try-pattern" returns false only for parse errors and rethrows everything else (e.g. MEMORY_LIMIT_EXCEEDED), so a future broad catch (...) cannot silently turn a fatal error into a default/skipped value while parse-error tests still pass. Uses a fake serialization whose deserializeText throws a configurable code, driven both directly (SimpleTextSerialization::tryDeserializeText) and through a composite (SerializationArray, exercising its restore-on-failure catch). No memory-tracker clamp, so it is deterministic. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1879729 to
692bc78
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 70/90 (77.78%) | Lost baseline coverage: none · Uncovered code |
0792ec4
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Do not swallow fatal errors (e.g. MEMORY_LIMIT_EXCEEDED) in tryDeserialize