-
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
ClickHouse exception, code: 1002, host: xxxx, port: xxx; xxxx:xxx failed to respond #717
Comments
Have you tried the most recent version |
I have not try 0.3.1-patch.And it is an insert operation.The exception stack is : |
I see. I don't think new version of the driver will help. The problem is server somehow actively closed the connection leaving JDBC driver holding a broken connection. Below was the code to reproduce the issue: The workaround being added for this is to simply retry idempotent operation(e.g. select query but not insert query). I'm sorry but currently I don't have a good solution for this except handling the error and retry at your end. I think we probably need an option to stop using pooled connection(before switching to HttpURLConnection), which might be of use. |
So the next release,can this problem be fixed?Thanks a lot! |
Do you have a connection pool that can be configured to validate the connection each time borrowing a connection from the pool? Usually it's a test query like I'm sorry that switching to HttpUrlConnection or a different httpclient is not something I can add in next release(0.3.2) because 1) it won't eliminate the issue(when it's the server which killed connection); and 2) I need to close grpc client to unblock future work first. |
same version and same problem |
Sorry to reply so late. We use datax(https://github.com/alibaba/DataX) , the writer has no connection pool, and gets a new connection only once when a task init. So i think that i can not count on this point. |
I see. I'm in the middle of refactoring the JDBC driver. Let me see if I can use URLConnection to replace apache http client in next release. |
Thanks so much! |
After adjust ck server |
Thanks for sharing your findings. Although Speaking of HTTP client, I took HttpURLConnection as default implementation in |
check your jdbc server is busy with full gc |
Two changes in 0.3.2 can mitigate the issue:
|
I'm closing this as the issue does not exist in the new JDBC driver #760 has summarized all the attempts very well along with additional change trying to fix the issue. However, based on flaky test reported in trino, the issue still exists. As far as I know, the issue was raised from Apache HTTP client when it tried to issue request using a connection being closed by server. Purging stale connection may have timing issue(actual execution time could be different from scheduled due to uncertainty of context switching), so I'm not sure if the issue can be completely fixed or not. Starting from 0.3.2, the driver has been rewritten and the old-school |
My ck-jdbc version is 0.2.6, this exception still occurs.Any help?
The text was updated successfully, but these errors were encountered: