Skip to content

HTTP Timeout does not work #149

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
szerwi opened this issue Jul 2, 2021 · 9 comments · Fixed by #150
Closed

HTTP Timeout does not work #149

szerwi opened this issue Jul 2, 2021 · 9 comments · Fixed by #150

Comments

@szerwi
Copy link

szerwi commented Jul 2, 2021

Here are my client's settings:

influxdb.setWriteOptions(WriteOptions().writePrecision(precision).batchSize(1).bufferSize(360).flushInterval(3600).retryInterval(5).maxRetryInterval(300).maxRetryAttempts(0));
influxdb.setHTTPOptions(HTTPOptions().httpReadTimeout(4000));

In connection params I set the address that does not exist.

Expected behavior:
influxdb.writePoint() should fail after 4 seconds.

Actual behavior:
It fails after about 15 seconds.

Specifications:

  • Library Version: 3.8.0
  • InfluxDB Version: 2.0.7
  • Board/ESP chip: ESP32
  • Device Arduino SDK version: ESP32 2.0.0-alpha1
@vlastahajek
Copy link
Collaborator

@szerwi, thanks for raising this issue. You are most probably using HTTPS for connecting to the server.
There is a problem that underlying WifiClientSecure has hardcoded timeout for establishing a secured connection 15s.
The overall initial client timeout is about 20s, because there is the MFLN negotiation before the first server request is sent, which has a hardcoded timeout 5s. And then comes the server request that timeouts in 15s.

@szerwi
Copy link
Author

szerwi commented Jul 9, 2021

Hi. Unfortunately, I'm using HTTP on ESP32, not ESP8266.

@vlastahajek
Copy link
Collaborator

Aha, my bad, sorry, I've overlooked your info, let me check again..

@vlastahajek
Copy link
Collaborator

@szerwi, it is possible set connection timeout for ESP32 for HTTP connection. But it will not work for HTTPS, because timeout connection is not implemented there yet.

@szerwi
Copy link
Author

szerwi commented Jul 9, 2021

@vlastahajek For the HTTP connection, do I need to set it using ESP32 libraries or using Influxdb library and functions that I've posted above?

@vlastahajek
Copy link
Collaborator

@szerwi, I've pushed the fix for this library. Just update the library from the master. No need to do any changes in your sources.

@szerwi
Copy link
Author

szerwi commented Jul 9, 2021

Why setting the timeout still won't work over HTTPS? Is it dependent from you or is it a bug in ESP32 libraries?

@vlastahajek
Copy link
Collaborator

vlastahajek commented Jul 9, 2021

It is the problem in the WifiClientSecure in the ESP32 SDK (tested in 1.0.6). I will post new issue there later.

@vlastahajek
Copy link
Collaborator

FYI, my fix for ESP32 is merged. It should be part of the next release.

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