Skip to content
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

[client-v2] Prevent using http client before it is initialized #2011

Open
chernser opened this issue Dec 10, 2024 · 0 comments
Open

[client-v2] Prevent using http client before it is initialized #2011

chernser opened this issue Dec 10, 2024 · 0 comments
Assignees
Milestone

Comments

@chernser
Copy link
Contributor

Describe the bug

Apache HTTP Client is used internally to make http calls. It take a time to initialize it but application may start doing requests.
It will cause internal exception and exception is not recoverable.

Steps to reproduce

  1. Create client
  2. Immediately send some request

Expected behavior

Request is executed successfully

Error log

com.clickhouse.client.api.ClientException: Failed to execute request
	at com.clickhouse.client.api.internal.HttpAPIClientHelper.executeRequest(HttpAPIClientHelper.java:385)
	at com.clickhouse.client.api.Client.lambda$insert$7(Client.java:1393)
	at com.clickhouse.client.api.Client.runAsyncOperation(Client.java:1942)
	at com.clickhouse.client.api.Client.insert(Client.java:1485)
	at 
...
Caused by: java.lang.IllegalStateException: Connection pool shut down
	at org.apache.hc.core5.util.Asserts.check(Asserts.java:38)
	at org.apache.hc.core5.pool.LaxConnPool.lease(LaxConnPool.java:163)
	at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.lease(PoolingHttpClientConnectionManager.java:298)
	at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.acquireEndpoint(InternalExecRuntime.java:103)
	at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:125)
	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
	at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
	at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96)
	at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)

Configuration

Environment

  • Client version: 0.7.1
@chernser chernser added this to the 0.7.2 milestone Dec 10, 2024
@chernser chernser self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant