Skip to content

fix(query-engine): fail loudly on accumulator serialization errors - #711

Merged
milindsrivastava1997 merged 1 commit into
mainfrom
673-fail-loudly-when-accumulator-serialization-fails
Sep 4, 2026
Merged

fix(query-engine): fail loudly on accumulator serialization errors#711
milindsrivastava1997 merged 1 commit into
mainfrom
673-fail-loudly-when-accumulator-serialization-fails

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Summary

  • SerializableToSink::serialize_to_json/serialize_to_bytes now return Result<_, SerializationError> instead of swallowing msgpack/serde encode failures via .unwrap_or_default(), which produced an empty payload indistinguishable from a legitimate empty sketch.
  • Fixed the 7 accumulator impls (HLL, CMS, CMS-with-heap, DeltaSetAggregator, HydraKLL, SetAggregator's arroyo helper, DatasketchesKLL) that hit this bug, plus KeyByLabelValues and PrecomputedOutput, which had the same swallow-to-default pattern.
  • PrecomputeDumper::dump_precompute now propagates the error with the failing accumulator's type and the record's aggregation_id attached, and writes nothing to the dump file when serialization fails.
  • Added regression tests: a poisoned-accumulator unit test at the trait boundary, and a PrecomputeDumper test asserting the error message and that no record is persisted.

Test plan

  • cargo test -p query_engine_rust -p asap_types --lib — 616 + 58 tests pass
  • cargo clippy -p query_engine_rust -p asap_types --lib --tests -- -D warnings — clean
  • cargo fmt --check — clean

Fixes #673.

🤖 Generated with Claude Code

serialize_to_bytes/serialize_to_json swallowed msgpack encode failures
via unwrap_or_default(), producing an empty payload indistinguishable
from a legitimate empty sketch. SerializableToSink now returns a
Result carrying the failing type's name and underlying error, and
PrecomputeDumper propagates that with the aggregation id attached so
nothing is persisted for a record that failed to serialize.

Fixes #673.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJsHNWn3uJK5iyk1L6isw7
@milindsrivastava1997 milindsrivastava1997 linked an issue Sep 4, 2026 that may be closed by this pull request
@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 4, 2026 13:20
@milindsrivastava1997
milindsrivastava1997 merged commit 1fd1448 into main Sep 4, 2026
17 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the 673-fail-loudly-when-accumulator-serialization-fails branch September 4, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail loudly when accumulator serialization fails

1 participant