Skip to content

fix(client-v2,jdbc-v2): handle tagged errors in response streams - #3097

Open
jjj-n wants to merge 2 commits into
ClickHouse:mainfrom
jjj-n:codex/issue-3077-stream-timeout
Open

fix(client-v2,jdbc-v2): handle tagged errors in response streams#3097
jjj-n wants to merge 2 commits into
ClickHouse:mainfrom
jjj-n:codex/issue-3077-stream-timeout

Conversation

@jjj-n

@jjj-n jjj-n commented Sep 3, 2026

Copy link
Copy Markdown

Summary

  • Handle ClickHouse tagged exception frames embedded at the end of successful HTTP response streams in client-v2.
  • Authenticate the frame with the X-ClickHouse-Exception-Tag response header and throw ServerException when it is reached, while preserving ordinary payload bytes and markers with mismatched tags.
  • Map a nested ClickHouse TIMEOUT_EXCEEDED error (code 159) encountered by ResultSet.next() to SQLTimeoutException with SQLState HYT00, preserving the original cause and vendor code.
  • Update CHANGELOG.md and docs/features.md for the user-visible behavior.

Compatibility: no existing public method signatures, configuration defaults, or successful result formats are changed. The change intentionally makes tagged server failures visible as exceptions instead of result data. HEADER_EXCEPTION_TAG is an additive public constant.

Closes #2702
Closes #3077

Test

  • Targeted client-v2 tests: HttpExceptionInputStreamTest, HttpResponseExceptionTest
  • Targeted jdbc-v2 test: ResultSetTimeoutTest
  • Full module suites: client-v2 (662 tests) and jdbc-v2 (1,500 tests), 2,162 tests total with 0 failures, 0 errors, and 0 skipped
  • packages/clickhouse-jdbc-all and its required modules packaged successfully
  • A live-server Docker integration run was not available in the local environment; the exact response-stream and ResultSet paths are covered by focused tests

Checklist

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 1df2252. Configure here.

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.

[jdbc-v2] Handle query timeout in the middle of stream [client-v2] Handle new error tag from ClickHouse

1 participant