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

No request timeout causing points not being written to influxdb #221

Closed
jorisplusplus opened this issue Apr 8, 2021 · 3 comments · Fixed by #222
Closed

No request timeout causing points not being written to influxdb #221

jorisplusplus opened this issue Apr 8, 2021 · 3 comments · Fixed by #222
Labels
bug Something isn't working
Milestone

Comments

@jorisplusplus
Copy link

We have deployed some IOT sensors and we are seeing some sensors not reporting values for periods of 15 min or more. I believe this is caused because there is no request_timeout used in the rest.py. In the debug logs of the program the last line is the post request being made and getting no response. This causes the influxdb client to stop writing points to the influxdb.

I thought the timeout parameter of the InfluxDBClient is setting the request timeout? If not, is it possible to set the request timeout? Because it is supported in the rest.py file (lines 159-165)

Steps to reproduce:
Minimal piece of code I run to reproduce.

from influxdb_client import InfluxDBClient, Point
from influxdb_client.client.write_api import SYNCHRONOUS

client = InfluxDBClient(url="http://127.0.0.1:8080", token="token", org="org", debug=True, timeout=1000)
write_api = client.write_api(write_options=SYNCHRONOUS)

p = Point("point").tag("tag","tag").field("Field", 1.0)
write_api.write(bucket="bucket", record=p)
  1. run nc -l -k -p 8080 (to host a tcp server for the client to connect to)
  2. run code shown above

Expected behavior:
I would expect it to raise an exception, restart the connection or resend the post request

Actual behavior:
Post request is made and continues waiting until the program is restarted.

Specifications:

  • Client Version: 0.16.0
  • InfluxDB Version: N/A
  • Platform: Linux
@bednar
Copy link
Contributor

bednar commented Apr 8, 2021

@jorisplusplus, thanks for issue, We will take a look.

@bednar
Copy link
Contributor

bednar commented Apr 9, 2021

Hi @jorisplusplus,

The issue is fixed in 1.17.0 milestone.

If you would like to use a dev version then install client via:

pip install git+https://github.com/influxdata/influxdb-client-python.git@master

Regards

@jorisplusplus
Copy link
Author

Thank you very much for the quick fix.

I will test it on some of the sensors, hopefully the problem is now solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants