Skip to content

How to set timeout config #141

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

Closed
ChunyunShen opened this issue Jan 20, 2022 · 4 comments
Closed

How to set timeout config #141

ChunyunShen opened this issue Jan 20, 2022 · 4 comments

Comments

@ChunyunShen
Copy link

When I establish a clickhouse client to send requests to clickhouse server, I expect to set a maximum time for each request. When timeout occurs, client should stop waiting for server. However, I find in the class Client this mechanism is not supported.
Are there any other ways to achieve this goal?

@filimonov
Copy link
Contributor

Not supported now. Feel free to add/send PR.

See https://stackoverflow.com/a/2939145

@Enmk
Copy link
Contributor

Enmk commented Mar 2, 2022

@ChunyunShen you can try using Client::SelectCancelable together with in-query SETTING clause. But right now there are no tests that properly verify that.

King-Authur added a commit to King-Authur/clickhouse-cpp that referenced this issue Jul 22, 2022
King-Authur added a commit to King-Authur/clickhouse-cpp that referenced this issue Jul 22, 2022
@King-Authur
Copy link

In the working environment, we encountered the situation that the clickhouse machine hangs up several times. At this time, the server can receive the client's request, but will not respond, which will cause the client to be stuck in the recv() link, which will affect the subsequent data. write.
Adding the timeout config and cooperating with the logic of switching the write replica when the write fails can avoid the above problems.

@rr0gi
Copy link

rr0gi commented Nov 8, 2022

fixed in #205 ?

@Enmk Enmk closed this as completed Apr 17, 2023
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

5 participants