-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Reset Error Occurs Occasionally with Client-v2 0.7.2 #2070
Comments
Good day, @lelewolf ! |
@lelewolf
Note: |
Hi @chernser, I’m running the application in a Spring Boot environment, and the issue does not occur during client loading. Below, I’ve provided the gc.log, although I’m not sure if the problem is GC-related. Currently, there’s a specific SQL query that always triggers this issue. However, when I execute the same SQL in DBeaver, it works fine and returns results as expected. This leads me to suspect that the issue might be related to the client or its configuration. Here’s the gc.log file and the analysis result: Analysis Result: Let me know if you need additional details! |
Hi @chernser, After comparing DBeaver’s configuration with my own client configuration, I made some adjustments, and the “Connection reset” issue no longer occurs. DBeaver’s configuration: My latest configuration: Let me know if you need further details or assistance! |
I got the same issue when When using But use bulk insert instead of a lot of async insert will solve this error. |
Seems we don't catch clickhouse-java/client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java Lines 376 to 406 in b6752c2
But I've commit another PR to fix |
@lelewolf thank you for information! Just to highlight - here is you configuration but client-v2 ignores some options: return new Client.Builder()
.addEndpoint(clickHouseConfig.getUrl())
.setUsername(clickHouseConfig.getUsername())
.setPassword(clickHouseConfig.getPassword())
.setSocketTimeout(clickHouseConfig.getSocketTimeout(), ChronoUnit.HOURS)
.setSocketKeepAlive(Boolean.TRUE)
.setConnectTimeout(clickHouseConfig.getConnectionTimeout(), ChronoUnit.HOURS)
.setConnectionTTL(clickHouseConfig.getConnectionTtl(), ChronoUnit.MINUTES)
.setMaxConnections(clickHouseConfig.getMaxConnection())
.enableConnectionPool(Boolean.TRUE) .setMaxRetries(3)
.setOption(ClickHouseClientOption.ASYNC.getKey(), "false") // by default
.setOption(ClickHouseClientOption.AUTO_DISCOVERY.getKey(), "true") // ignored
.setOption(ClickHouseClientOption.LOAD_BALANCING_POLICY.getKey(), "roundRobin") // ignored
.setOption(ClickHouseClientOption.HEALTH_CHECK_INTERVAL.getKey(), "60000") // ignored
.useHttpCompression(Boolean.TRUE) .compressClientRequest(Boolean.TRUE)
.setOption(ClickHouseHttpOption.CONNECTION_PROVIDER.getKey(), HttpConnectionProvider.HTTP_URL_CONNECTION.name()) // ignored So question is what DBeaver configuration property resolve the issue? As for the query:
|
Good day, @lelewolf! One more question: how do you read result data? Let me explain why I'm asking: Thanks! |
Hi @chernser, Thank you for your detailed analysis and insights! The purpose of downgrading was to enable the configuration: During the troubleshooting process, there were no changes made to the server configuration. Additionally, the application code was not updated. Let me know if you need any further details. Thanks! |
Good day, @lelewolf ! How do you read information from a response? Thanks! |
Describe the bug
There is an issue where the ClickHouse client fails to execute a query, resulting in a “Connection reset” error. The request is being terminated unexpectedly.
Steps to reproduce
Expected behaviour
The client should execute the query successfully without encountering a connection reset error, even with high traffic or under timeout conditions.
Code example
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: