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

Unconfigurable timeout causing long queries to fail. #94

Closed
allstream opened this issue Apr 24, 2020 · 4 comments · Fixed by #100
Closed

Unconfigurable timeout causing long queries to fail. #94

allstream opened this issue Apr 24, 2020 · 4 comments · Fixed by #100
Assignees

Comments

@allstream
Copy link

Timeout: time.Second * 20,

The Line above is unconfigurable through the provided API-Interface and it essentially seems to force all queries to be <=20 seconds. Am I missing something or is this configurable? I can't seem to get around it.

I constantly get the error:
Post "https://localhost/api/v2/query?org=testing_queries": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

@vlastahajek vlastahajek self-assigned this Apr 24, 2020
@vlastahajek
Copy link
Contributor

@allstream, unfortunately, it is not configurable now. We will make this configurable in the next version. You should be able to work-around this by manually changing the library sources in the package folder.
On the other hand, a query shouldn't take so long. Is the server under a heavy load?
Or, are you expecting a lot of rows returned, or do you use some data manipulation functions on a lot of rows?

@allstream
Copy link
Author

@vlastahajek Thanks for the quick response. To answer your question about heavy load / lots of results:
I've been doing some benchmarks since I'm looking at various TSDB's to see what matches our organizations needs and thought that this was a strange issue. The query would return a lot of results, wouldn't say it's heavy load.

@vlastahajek
Copy link
Contributor

vlastahajek commented Apr 24, 2020

@allstream, I've managed to add the update for this in the version we've released today. Check new version, please, if it works for you. The default timeout remained the same, but you can change it easily:

client := influxdb2.NewClientWithOptions("http://localhost:9999", "token", DefaultOptions().SetHttpRequestTimeout(50))

@allstream
Copy link
Author

@vlastahajek Got the new version and changed my code and it's all working great! took 24 seconds to run my query. Thanks a lot!

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

Successfully merging a pull request may close this issue.

2 participants