-
Notifications
You must be signed in to change notification settings - Fork 60
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
Thread blocked #153
Comments
Hi @MrZhao1024B, it's a warning from Vert.x but it should not block your next query. Are you using latest JDBC bridge? |
Hi@zhicwu, I'm using the latest JDBC bridge. Only execute a query that takes a long time to return results, Creating a new query will fail, and I need to wait for the task to finish before executing a new query. |
There was an issue(#113) like this but it's been fixed. Just want to double confirm with you: 1) by latest version you meant 2.1.0, right? and 2) if connection pool is used, its maximum size is greater than one. Will try if I can reproduce the issue on 2.1.0. |
My JDBC bridge version is 2.1.0, clickhouse version is 21.12.3.32. "maximumPoolSize": 5 |
Thanks for the extra information. What's your query looks like? How many jdbc table functions appear in your query? 3 connections will be used for one query like below: select * from jdbc('ds1', 'query1')
union all
select * from jdbc('ds1', 'query2')
union all
select * from jdbc('ds1', 'query3') |
My query has only one JDBC table function. Tests have found that.
|
I was not able to reproduce the issue. What's the target database? It looks like the first query leads to a table lock? |
My target database is Oracle. But my first query using oracle, and my second query using sqlserver will have the same problem. So the reason is not because the table is locked. |
I see what's going on there. By design, JDBC bridge will perform scheme inferring for each query. This is to help Clickhouse to understand the table schema. Usually it simply issue the original query with fetch size and max rows set to 1. This works well for the first case but not the second(not sure why count query is so slow in your environment). To avoid the extra query, you have to either use named query(query in json config file), or issue a query like |
Thank you for your advice. When I execute query My count query was so slow. A new query should not be blocked because of this. |
It seems that the schema query is a serial method? when there is a long query such as all the query is blocked. but when running It work well . |
I think this is maybe the root cause. In I found this When running a long sql. It's metioned in caffeine docs , see
|
Any progress on making |
I modify JdbcBridgeVerticle
to
|
When I execute an SQL query that takes a long time, I get thread blocked,
and creating a new query will fail
The text was updated successfully, but these errors were encountered: