Skip to content

Conversation

@bouk
Copy link

@bouk bouk commented Nov 23, 2025

This should fix issues when loading many tables at the same time. I've not tested this, since I don't have airbyte running locally, just using it

What

I kept getting this issue:

2025-11-22 19:12:40 destination ERROR com.clickhouse.client.api.ClientException: Query request failed after attempts: 4 - Duration: 40006856041
2025-11-22 19:12:40 destination ERROR 	at com.clickhouse.client.api.Client.lambda$query$5(Client.java:1590)
2025-11-22 19:12:40 destination ERROR 	at com.clickhouse.client.api.Client.runAsyncOperation(Client.java:1982)
2025-11-22 19:12:40 destination ERROR 	at com.clickhouse.client.api.Client.query(Client.java:1593)
2025-11-22 19:12:40 destination ERROR 	at com.clickhouse.client.api.Client.query(Client.java:1479)
2025-11-22 19:12:40 destination ERROR 	at com.clickhouse.client.api.Client.execute(Client.java:1898)
2025-11-22 19:12:40 destination ERROR 	at io.airbyte.integrations.destination.clickhouse.client.ClickhouseAirbyteClient.execute$io_airbyte_airbyte_integrations_connectors_destination_clickhouse(ClickhouseAirbyteClient.kt:275)
2025-11-22 19:12:40 destination ERROR 	at io.airbyte.integrations.destination.clickhouse.client.ClickhouseAirbyteClient.createTable-9FR0I8Y(ClickhouseAirbyteClient.kt:60)
2025-11-22 19:12:40 destination ERROR 	at io.airbyte.cdk.load.orchestration.db.direct_load_table.DirectLoadTableAppendTruncateStreamLoader.start(DirectLoadTableStreamLoader.kt:217)
2025-11-22 19:12:40 destination ERROR 	at io.airbyte.cdk.load.dataflow.DestinationLifecycle$initializeIndividualStreams$1$result$1$1.invokeSuspend(DestinationLifecycle.kt:68)
2025-11-22 19:12:40 destination ERROR 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2025-11-22 19:12:40 destination ERROR 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
2025-11-22 19:12:40 destination ERROR 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
2025-11-22 19:12:40 destination ERROR 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829)
2025-11-22 19:12:40 destination ERROR 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
2025-11-22 19:12:40 destination ERROR 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
2025-11-22 19:12:40 destination ERROR 	Suppressed: com.clickhouse.client.api.ClientException: Query request failed after attempts: 4 - Duration: 40006892918
2025-11-22 19:12:40 destination ERROR 		... 15 more
2025-11-22 19:12:40 destination ERROR 	Caused by: com.clickhouse.client.api.ConnectionInitiationException: Query request failed (Attempt: 4/4 - Duration: 40005900881)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.internal.HttpAPIClientHelper.wrapException(HttpAPIClientHelper.java:668)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.Client.lambda$query$5(Client.java:1579)
2025-11-22 19:12:40 destination ERROR 		... 14 more
2025-11-22 19:12:40 destination ERROR 	Caused by: org.apache.hc.core5.http.ConnectionRequestTimeoutException: Timeout deadline: 10000 MILLISECONDS, actual: 10000 MILLISECONDS
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.acquireEndpoint(InternalExecRuntime.java:120)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:125)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.classic.HttpClient.executeOpen(HttpClient.java:183)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.internal.HttpAPIClientHelper.executeRequest(HttpAPIClientHelper.java:415)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.Client.lambda$query$5(Client.java:1550)
2025-11-22 19:12:40 destination ERROR 		... 14 more
2025-11-22 19:12:40 destination ERROR 	Suppressed: com.clickhouse.client.api.ClientException: Query request failed after attempts: 4 - Duration: 40005155479
2025-11-22 19:12:40 destination ERROR 		... 15 more
2025-11-22 19:12:40 destination ERROR 	Caused by: com.clickhouse.client.api.ConnectionInitiationException: Query request failed (Attempt: 4/4 - Duration: 40004545840)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.internal.HttpAPIClientHelper.wrapException(HttpAPIClientHelper.java:668)
2025-11-22 19:12:40 destination ERROR 		at com.clickhouse.client.api.Client.lambda$query$5(Client.java:1579)
2025-11-22 19:12:40 destination ERROR 		... 14 more
2025-11-22 19:12:40 destination ERROR 	Caused by: org.apache.hc.core5.http.ConnectionRequestTimeoutException: Timeout deadline: 10000 MILLISECONDS, actual: 10000 MILLISECONDS
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.acquireEndpoint(InternalExecRuntime.java:120)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:125)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
2025-11-22 19:12:40 destination ERROR 		at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)

When loading 15 schemas at the same time, I could see from the logs it was doing 20 queries at once:

2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`locations`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputylocations0d04ec724b67951a327198bda65c11e9`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`employees`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputyemployees4eb807a911792b3f0022d4ea79ecab1a`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`award_lists`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputyaward_lists3c7dfbfa392a7d604c66c476465f3b19`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`departments`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputydepartments699765aac54e3da18eccbdd8a47438a9`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`timesheets`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputytimesheets803d3bffdc18e5d60d6c9b1f24b803bc`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`tasks`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputytasks22ec78dd68cf2ee4e4aee4824006aa3d`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`news_feed`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputynews_feeda359f9168c1ddc04cf7dab83850522da`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`addresses`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputyaddresses4954d4a09bcc31137983062d3a2db88f`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`categories`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputycategories404466076676daa8976abd426a8aae7a`;
2025-11-22 19:02:39 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`comments`;
2025-11-22 19:02:40 destination INFO main i.a.i.d.c.c.ClickhouseSqlGenerator(andLog):52         SELECT count(1) cnt FROM `deputy`.`deputycommentsde4cb354b908b771598c59fb1e2c72c8`;

and this seems to match this clickhouse-java issue I found: ClickHouse/clickhouse-java#1741

How

Upgrade clickhouse client to include the latest fixes

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

This should fix issues when loading many tables at the same time, see ClickHouse/clickhouse-java#1741
@bouk bouk requested a review from a team as a code owner November 23, 2025 13:19
@CLAassistant
Copy link

CLAassistant commented Nov 23, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

👋 Welcome to Airbyte!

Thank you for your contribution from bouk/airbyte! We're excited to have you in the Airbyte community.

Helpful Resources

PR Slash Commands

As needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
  • /run-connector-tests - Runs connector tests.
  • /run-cat-tests - Runs CAT tests.
  • /run-live-tests - Runs live tests for the modified connector(s).
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).

If you have any questions, feel free to ask in the PR comments or join our Slack community.

Tips for Working with CI

  1. Pre-Release Checks. Please pay attention to these, as they contain standard checks on the metadata.yaml file, docs requirements, etc. If you need help resolving a pre-release check, please ask a maintainer.
    • Note: If you are creating a new connector, please be sure to replace the default logo.svg file with a suitable icon.
  2. Connector CI Tests. Some failures here may be expected if your tests require credentials. Please review these results to ensure (1) unit tests are passing, if applicable, and (2) integration tests pass to the degree possible and expected.
  3. (Optional.) BYO Connector Credentials for tests in your fork. You can optionally set up your fork with BYO credentials for your connector. This can significantly speed up your review, ensuring your changes are fully tested before the maintainers begin their review.

📝 Edit this welcome message.

@DanyloGL
Copy link
Collaborator

DanyloGL commented Nov 24, 2025

/run-connector-tests

Connector CI Tests Started

These tests will leverage Airbyte's integration test credentials.

Check job output.
✅ Connector CI Tests job completed successfully. See logs for details.

@DanyloGL
Copy link
Collaborator

@bouk thank you for your contribution!
Could you please increase dockerImageTag in metadata.yaml file and update changelog section in docs file?

@DanyloGL DanyloGL moved this from New PRs to Waiting Contributor in 🧑‍🏭 Community Pull Requests Nov 24, 2025
@bouk
Copy link
Author

bouk commented Nov 24, 2025

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting Contributor

Development

Successfully merging this pull request may close these issues.

4 participants