Fix: Fix Bzip2ReadBuffer throwing UNEXPECTED_END_OF_FILE on empty stream#101691
Fix: Fix Bzip2ReadBuffer throwing UNEXPECTED_END_OF_FILE on empty stream#101691Avogar merged 6 commits intoClickHouse:masterfrom
Conversation
PR ClickHouse#99034 added empty-stream guards to gzip, zstd, brotli, lz4, and lzma decompression buffers but missed bzip2. When the inner stream is empty (e.g. a URL returned 404 with http_skip_not_found_url_for_globs), Bzip2ReadBuffer now sets eof_flag and returns false instead of throwing UNEXPECTED_END_OF_FILE. Closes ClickHouse#99806 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Workflow [PR], commit [3b7b1c6] Summary: ✅ AI ReviewSummaryThis PR fixes ClickHouse Rules
Final Verdict
|
|
CI failure in |
|
@clickgapai Fix the |
|
Understood — I'll fix the |
|
Closing this PR per review feedback. The underlying bug analysis (Bzip2ReadBuffer missing empty-stream guard) stands and will be refiled as an issue. The |
|
I'll work on fixing the |
|
Filed separate PR: #101810 |
…exist The install_check RPM tests use glob patterns that match all versions in the packages directory. When both base and PR builds are present, yum fails with version conflicts. Fix by extracting the newest version and filtering by it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI Failure Analysis: Stress test (arm_msan)Verdict: UNRELATED_BREAKAGE — no action needed on our part. The failure is
This failure should be retried or ignored as it is not caused by our changes. |
…2 fix The version-selection logic was unrelated to the `Bzip2ReadBuffer` empty-stream guard fix. Master already has the `--allowerasing` fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LLVM Coverage Report
Changed lines: 100.00% (11/11) · Uncovered code |
|
Hi — this PR may need backporting to Affected code: Why: The bzip2 empty stream bug has existed since bzip2 support was added in commit 9a45458 (2021-08-07), which predates all supported branches. PR #99034 fixed other compression formats on 2026-03-09 but missed bzip2. All supported branches have this bug. The fix is small (7 lines) and safe. If this should be backported, consider adding |
Found via ClickGap automated review. Please close or comment if this is incorrect.
Implements fix for the issue discussed in PR #99912.
Requested by @alexey-milovidov.
What this fixes
What: Added empty-stream guard to Bzip2ReadBuffer so it returns EOF instead of throwing UNEXPECTED_END_OF_FILE when the inner stream is empty.
Why: PR #99034 added this guard to all other decompression formats (gzip, zstd, brotli, lz4, lzma) but missed bzip2, causing errors when reading 404 URLs with
http_skip_not_found_url_for_globs=1.Test: Extended existing test
04032_empty_gzip_stream_from_urlto cover the bzip2 case — queries a 404-returning HTTP server with.bz2glob URLs and verifies it returns 0 rows without error.PR pushed: yes
Changes
See diff for source files changed + test added.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
What: Added empty-stream guard to Bzip2ReadBuffer so it returns EOF instead of throwing UNEXPECTED_END_OF_FILE when the inner stream is empty.
Documentation entry for user-facing changes
ClickGapAI · Fix for PR #99912