-
Notifications
You must be signed in to change notification settings - Fork 117
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
Provide an example how to get errors from asynchronous write API #102
Comments
@fafnirbcrow , WriteApi contains the Errors() method, which returns channel for write errors. |
I believe I see, so something like?
Since its a generic error object, how would we know which of the writes failed? Or should the entire batch be retried since it will overwrite in the db? |
You can't pair a received error and a batch now. Batches are automatically retried on server overload (server responds with defined error codes). Asynchronous write API best suits for writing frequent, nonprecious, data, such as telemetry, system metrics monitoring, weather sensing, etc. You can use synchronous write API if you need control over write errors. |
That makes sense. Might I recommend that information be added to the documentation, including an example of error handling. It would be a useful inclusion for people like me who are trying to get a handle on flux still. |
Definitely. I was already planning to do so... |
I was trying to upgrade my client from the v0.1.5 version we were previously using, however I am unsure how I am supposed to handle errors properly with the async writer functions.
In
influxdb-client-go/write.go
Line 203 in e9749ef
If the service returns an error, it gets returned to a logger. and that is it.
That logger seems to be an instance of
influxdb-client-go/internal/log/logger.go
Line 14 in e9749ef
Which only does prints.
What is the expected method to identify and handle failures on data writes, and set up an automatic retry?
The text was updated successfully, but these errors were encountered: