You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
We occasionally receive a http status 500 code (time out) from our influxdb instance, probably because of temporary peak load. Looking at the retry code in InfluxDBClient class I can see that you try to catch HTTPErrors (line 345):
@russorat in your example it gets printed because it's a 'ConnectionError', and not a 'HTTPError'. Please try this code which will connect to httpstat.us to return a http error code 500:
# import requests module
import requests
try:
# get a http status code 500
response = requests.get('https://httpstat.us/500')
print(response)
# comment this and exception will not be raised
response.raise_for_status()
except (requests.exceptions.ConnectionError,
requests.exceptions.HTTPError,
requests.exceptions.Timeout):
# will only be printed if raise_for_status() is called
print("exception")
We occasionally receive a http status 500 code (time out) from our influxdb instance, probably because of temporary peak load. Looking at the retry code in InfluxDBClient class I can see that you try to catch HTTPErrors (line 345):
influxdb-python/influxdb/client.py
Lines 326 to 353 in fc0235e
According to the requests library documentation a raise_for_status() is needed for the exception to be caught:
https://requests.readthedocs.io/en/master/user/quickstart/#errors-and-exceptions
Or am I missing something?
The text was updated successfully, but these errors were encountered: