Repository navigation
[v0.11.0] Do not fail closing a partly read response that the server ended early (backport #3217) - #3234
Open
polyglotAI-bot wants to merge 1 commit into
Open
[v0.11.0] Do not fail closing a partly read response that the server ended early (backport #3217)#3234polyglotAI-bot wants to merge 1 commit into
polyglotAI-bot wants to merge 1 commit into
Conversation
…y-read-response [client-v2, jdbc-v2] Do not fail closing a partly read response that the server ended early (cherry picked from commit 848b311)
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports #3217 from
maintov0.11.0, as requested by @chernser in #3231 (comment):Issue: #3231 (a closing keyword has no effect on a PR into a non-default branch, so close the issue manually after merge).
Cherry-picked PR
main848b3116bResultSet#close()/QueryResponse#close()do not fail when the server ended a partly read response early (#3203)536f9842c(clean)Command:
git cherry-pick -x -m 1 848b3116b. The commit keeps its original author and records its source commit.Conflicts
None. The diff (4 files, +154/−2) is identical to the diff of #3217 on
main, hunk by hunk. Only the blob index hashes are different. The branch has no other changes.Note:
history/latest/3203.md(the release-note fragment of #3217) createshistory/latest/on this branch, becausev0.11.0does not have that directory. I kept the file as is, because the request is git tools only. Move it intohistory/0_11_0_release/CHANGELOG.mdif the branch needs a different release-note layout.Test
Done in a devbox (JDK 17 + JDK 8 toolchain, ClickHouse server 26.9.1):
mvn -B -pl client-v2,jdbc-v2 -am -DskipTests -Dmaven.javadoc.skip=true install:BUILD SUCCESS.jdbc-v2ResultSetImplTest(integration): 20 run, 0 failures. This includes the 2 newtestCloseNotFullyReadResultSetcases.client-v2HttpTransportTests(integration): 96 run, 69 pass. The 3 newtestClosingNotFullyReadResponsecases pass.v0.11.0: with onlyHttpAPIClientHelper.javareverted tov0.11.0, the 3 newtestClosingNotFullyReadResponsecases fail.HttpTransportTestsfailures are the same with and without this change. They are environment failures: the tests connect to the hardcodedlocalhost:8123/localhost:8443, which are not reachable in this environment (the server has a different host name), andtestServerErrorHandlingexpects error code 636 where this server returns 400. CI runs them against a local server.This PR adds no tests, docs or version bump other than those in #3217.
Checklist
🤖 Generated with Claude Code
Note
Medium Risk
Changes HTTP response teardown for failed mid-stream queries; behavior differs only on close after partial reads, but affects shared transport used by client-v2 and jdbc-v2.
Overview
Backports the fix for #3203 so closing a partly read query response no longer surfaces misleading HTTP chunk errors (
Premature end of chunk coded message body…) when ClickHouse ends the body early after a mid-stream query failure.In
HttpAPIClientHelper, response bodies are wrapped in aResponseBodyInputStreamthat swallowsConnectionClosedExceptiononclose()(logged at DEBUG withqueryId) once a data stream was opened;TransportResponseImpl.close()applies the same rule. Active reads still fail as before, and paths that never open the result stream (Client#execute,Statement#executeUpdate) still propagateConnectionClosedExceptionso failures remain visible.Adds integration tests for client-v2 HTTP transport (compression variants) and jdbc-v2
ResultSet#close(), plus a release-note entry inhistory/latest/3203.md.Reviewed by Cursor Bugbot for commit 536f984. Bugbot is set up for automated code reviews on this repo. Configure here.