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

The driver does not work #429

Open
alexey-milovidov opened this issue Sep 24, 2023 · 4 comments
Open

The driver does not work #429

alexey-milovidov opened this issue Sep 24, 2023 · 4 comments

Comments

@alexey-milovidov
Copy link
Member

It prints

Session ... is locked by a concurrent client.

I'm wondering how anyone can use it.

See ClickHouse/ClickHouse#54952

@mshustov
Copy link
Member

mshustov commented Oct 9, 2023

@alexey-milovidov IIRC, you mentioned it was an incorrect usage. Could you provide more details?

@gfody
Copy link

gfody commented Mar 21, 2024

same issue here using the odbc driver from SQL Server (CLICKHOUSEODBCW.DLL 1.02.01.35817 2022-09-09)

Code: 373. DB::Exception: Session clickhouse_odbc_6468917993997271918 is locked by a concurrent client. (SESSION_IS_LOCKED) (version 23.9.6.20 (official build))

the error is intermittent/random but seems related to server load

@mshustov
Copy link
Member

seems related to server load

@gfody could you elaborate please?

@gfody
Copy link

gfody commented Mar 27, 2024

seems related to server load

@gfody could you elaborate please?

while testing we noticed that the longer it takes for the queries to execute the more likely we were to hit this exception

eg

select * from openrowset('MSDASQL',
'Driver={ClickHouse ODBC Driver (Unicode)};username=...;password=...;url=http://...',
'select .... limit 100000')

testing with different numbers for limit 100000 increasing it seems to increase the odds that we'll hit the "locked by concurrent client" exception, although it really is very random. we also tested various querystring parameters in url as elsewhere it was mentioned to try setting wait_end_of_query=1 and different values for buffer_size .. the rate of this exception seemed mostly dependent on the limit or execution duration.

if we try setting session_id to some random value then we always immediately get the exception 100% of the time, eg:

select * from openrowset('MSDASQL',
'Driver={ClickHouse ODBC Driver (Unicode)};username=...;password=...;url=http://...?session_id=123456789',
'....')

OLE DB provider "MSDASQL" for linked server "(null)" returned message "HTTP status code: 500
Received error:
Code: 373. DB::Exception: Session 123456789 is locked by a concurrent client. (SESSION_IS_LOCKED) (version 23.9.6.20 (official build))

edit - I tested again with session_id in the querystring and it's not 100% of the time, just as frequent as the other cases. It seems that there are windows of time where 100% of requests will hit this exception but it's not due to any of the parameters we were testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants