Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Raise InfluxDBServerError for server error instead of InfluxDBClientError #236

Merged
merged 1 commit into from
Sep 3, 2015

Conversation

PierreF
Copy link
Contributor

@PierreF PierreF commented Sep 2, 2015

Shouldn't InfluxDBServerError be raised when InfluxDB fail to serve a request (e.g. HTTP status is 5xx) instead of InfluxDBClientError.

I need this distinction, because I've some code retry writing when server fail (not started/starting) but discard malformed input. E.g. :

try:
    client.write_points(...)
except InfluxDBClientError:
    # do not retry this write, it means malformed points
except (InfluxDBServerError, ConnectionError):
   # do retry this write, it means server down/starting

This would also be valuable for InfluxDBClusterClient, who should go to next server if one of the server fail.

One case were InfluxDB return a 500 error code (that is not due to bad input) is during startup of single node, before metastore initialization. In this case I got the error metastore database error: no leader. This is obviously only a temporary error and few seconds later server is available.

@aviau
Copy link
Collaborator

aviau commented Sep 3, 2015

Thank you for contributing!

@aviau aviau closed this Sep 3, 2015
@aviau aviau reopened this Sep 3, 2015
aviau added a commit that referenced this pull request Sep 3, 2015
Raise InfluxDBServerError for server error instead of InfluxDBClientError
@aviau aviau merged commit d4d9700 into influxdata:master Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants