clickhouse-cpp icon indicating copy to clipboard operation
clickhouse-cpp copied to clipboard

Deadlock on executing special kind of query

Open OlegGalizin opened this issue 1 year ago • 3 comments

I try to write a loader from TVS format. So i run the query like

client.Execute("CREATE TEMPORARY TABLE IF NOT EXISTS test_client (id UInt64, name String)"); client.Execute("insert into test_client FORMAT TSV\n");

and got deadlock in client.Execute("insert into test_client FORMAT TSV\n");

The client waits answer from server - the ServerCodes::EndOfStream code. The server also waits something. I think it waits some data. What data format is it waiting? How to send the data that server waiting?

May be it is bug of the clickhouse server.

OlegGalizin avatar Sep 24 '24 09:09 OlegGalizin

@OlegGalizin It is not a bug.
client.Execute("insert into test_client FORMAT TSV 1\tClient1\n2\tClient2");

1261385937 avatar Sep 27 '24 03:09 1261385937

@Enmk @OlegGalizin Please close it

1261385937 avatar Sep 28 '24 09:09 1261385937

Ok. It is feature with deadlock. Here should be link to documentation to the feature that this type of query may be used to get column description for example. In OnDataCancelable must return false to prevent the deadlock.

OlegGalizin avatar Oct 01 '24 12:10 OlegGalizin