Query cancellation in ClickHouse #329
-
Hi, I use last version of My .NET application generates different complex and long-running |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @ruslanen Currently, there is no support for cancelling query on the server if cancelled on the client. This is an interesting idea to implement, but at the moment it is not there However, if your app is 'interactive' (i.e: it is only expected to run one query at a time), a way to solve this would be to use a single instance of |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, my application may have many parallel requests, so this option will not work for me. |
Beta Was this translation helpful? Give feedback.
Hi @ruslanen
Currently, there is no support for cancelling query on the server if cancelled on the client. This is an interesting idea to implement, but at the moment it is not there
However, if your app is 'interactive' (i.e: it is only expected to run one query at a time), a way to solve this would be to use a single instance of
ClickHouseConnection
withUseSession
flag alongsidereplace_running_query
setting and without customHttpClient
/HttpClientHandler
. This way, the library will spawn a single HTTP connection with same lifetime as theClickHouseConnection
instance, and executing next query will cause previous one to be cancelled