Skip to content

fix(cloudfetch): bump twox-hash to 2.1.3 and surface panicking download tasks - #243

Merged
eric-wang-1990 merged 3 commits into
mainfrom
eric-wang/cloudfetch-lz4-overflow-panic
Aug 12, 2026
Merged

eric-wang-1990 merged 3 commits into
mainfrom
eric-wang/cloudfetch-lz4-overflow-panic

Conversation

@eric-wang-1990

Copy link
Copy Markdown
Collaborator

Problem

The kernel's large-result CloudFetch nightly (databricks-sql-kernel-nightly.yml in databricks-driver-test) hangs until the 2h CI cap. Root-caused to a twox-hash 2.1.2 integer-overflow panic:

  • twox-hash 2.1.2's xxhash32::Hasher::finish_with finalizes with a non-wrapping + that overflows u32 → panics under debug overflow-checks (cargo test). Release builds wrap (correct xxHash), so this is debug/CI-only.
  • Reached via lz4_flex 0.14.0's FrameDecoder::check_block_checksum while MultiFrameLz4Reader decompresses a CloudFetch Arrow chunk. It's data-dependent, so a random chunk trips it.
  • The panic happens inside a fire-and-forget download task (StreamingCloudFetchProvider::schedule_downloads), whose JoinHandle is dropped — so tokio swallows it. The chunk stays Downloading forever, the in-memory window fills, scheduling halts, and the whole stream wedges.

Confirmed with a full backtrace and reproduced direct-to-Azure (no proxy).

Fix

  1. Bump twox-hash 2.1.2 → 2.1.3 (satisfies lz4_flex 0.14's twox-hash "2"). Resolves the overflow.
  2. Await the download task's JoinHandle from a supervisor task, so a panic surfaces as a JoinError → the chunk is marked DownloadFailed and the reader fails cleanly, instead of hanging forever. Defensive: prevents any future download-path panic from silently wedging the stream.

Validation

  • Streamed the full samples.tpch.lineitem (29,999,795 rows = COUNT(*), exact match, no data loss) direct to Azure in ~176s with twox-hash 2.1.3 — no panic (previously panicked on a random chunk within ~1-2 min).
  • cargo test --lib cloudfetch — 80 passed, 0 failed.

PECOBLR-4026

This pull request and its description were written by Isaac.

@eric-wang-1990
eric-wang-1990 marked this pull request as ready for review August 12, 2026 17:13
@eric-wang-1990
eric-wang-1990 requested a review from a team as a code owner August 12, 2026 17:13

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — the twox-hash 2.1.3 bump fixes the root-cause overflow panic, and join_download_task is a sound defensive guard that converts a swallowed task panic into a DownloadFailed chunk + notify_one(), so the reader fails cleanly instead of wedging. Terminal-state handling means no re-spawn/re-panic loop, cancellation stays cooperative, and the new unit test covers the helper. One non-blocking low note on the nested-spawn mechanics.

Addresses:
  - #3769905194 at src/reader/cloudfetch/streaming_provider.rs:574

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 3ea1c3b Aug 12, 2026
28 of 29 checks passed

This branch was previously deployed

1 inactive deployment
azure-prod — bbf4c7a0 Deployed Aug 12, 2026 by oss-reviewer-bot[bot] via followup #264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineer-bot Apply to an issue to trigger the engineer-bot; on a PR to enable engineer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants