Skip to content

Commit 1ed667d

Browse files
committed
Updated migration guide with status code handling
1 parent e240deb commit 1ed667d

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@
4646
previously set in milliseconds but mistakenly retrieved and used in seconds in some places. Now it correctly uses
4747
milliseconds consistently. (https://github.com/ClickHouse/clickhouse-java/issues/2358)
4848

49-
- **[client-v2]** HTTP `503 Service Unavailable` responses are now surfaced as a connection-style failure (`java.net.ConnectException`) and are retried by default. Previously a `503` was treated as a server error (`ServerException`) and fell under the `ServerRetryable` fault cause. It has been moved to the `ConnectTimeout` fault cause category so that connectivity/availability failures are handled uniformly with other connection errors. Callers that specifically excluded `ServerRetryable` to avoid retrying `503` should now adjust their `client_retry_on_failures` configuration to exclude `ConnectTimeout` instead.
49+
- **[client-v2]** HTTP `503 Service Unavailable` responses are now surfaced as a connection-style failure (
50+
`java.net.ConnectException`) and are retried by default. Previously a `503` was treated as a server error (
51+
`ServerException`) and fell under the `ServerRetryable` fault cause. It has been moved to the `ConnectTimeout` fault
52+
cause category so that connectivity/availability failures are handled uniformly with other connection errors. Callers
53+
that specifically excluded `ServerRetryable` to avoid retrying `503` should now adjust their
54+
`client_retry_on_failures` configuration to exclude `ConnectTimeout` instead.
5055

51-
- **[client-v2]** Unexpected/unknown HTTP status codes (those the client cannot interpret as a ClickHouse response) now throw a `ClientException` instead of a `ServerException`. Since the client cannot meaningfully handle these responses, they are reported as a client-side error rather than being attributed to the server.
56+
- **[client-v2]** Unexpected/unknown HTTP status codes (those the client cannot interpret as a ClickHouse response) now
57+
throw a `ClientException` instead of a `ServerException`. Since the client cannot meaningfully handle these responses,
58+
they are reported as a client-side error rather than being attributed to the server.
5259

5360
### New Features
5461

@@ -105,7 +112,11 @@
105112
supported but will be removed. Please migrate to the new property.
106113
(https://github.com/ClickHouse/clickhouse-java/issues/2858)
107114

108-
- **[client-v2]** Added `Client#cancelTransportRequest(String queryId)` to cancel an in-flight request that has not yet received a response from the server, identified by the query id supplied in the operation settings. This aborts the request on the client side (cancels the underlying IO operation) but does **not** issue a `KILL QUERY` on the server, so a query that already started executing may continue to run server-side. It is recommended to use operation timeout settings where possible; this API is intended for explicitly aborting a request from the client.
115+
- **[client-v2]** Added `Client#cancelTransportRequest(String queryId)` to cancel an in-flight request that has not yet
116+
received a response from the server, identified by the query id supplied in the operation settings. This aborts the
117+
request on the client side (cancels the underlying IO operation) but does **not** issue a `KILL QUERY` on the server,
118+
so a query that already started executing may continue to run server-side. It is recommended to use operation timeout
119+
settings where possible; this API is intended for explicitly aborting a request from the client.
109120

110121
### Improvements
111122

docs/releases/0_10_0.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ There are plans to support other HTTP clients and protocols, but they will be co
8383

8484
This property (not a feature) is deprecated. Please use `com.clickhouse.jdbc.DriverProperties#JDBC_TYPE_MAPPINGS` (`jdbc_type_mappings`) instead.
8585

86+
## CLIENT-V2: Service Unavailable Retry Behavior Changed
87+
88+
Http status code `503 Service Unavailable` is handled now as `ConnectionException`. It means that if
89+
retry is needed on this type of error than `client_retry_on_failures` should contain `ConnectTimeout`.
90+
Previously it was under `ServerRetryable` failure cause.
91+
92+
## CLIENT-V2: Handling unknown status codes
93+
94+
New version will throw `ClientException` instead of `ServerException` on any unhandled status code. Previously
95+
any such case was wrapped as `ServerException` what is not correct because it is client fails to process the code.

0 commit comments

Comments
 (0)