-
Notifications
You must be signed in to change notification settings - Fork 115
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
WriteAPIBlocking.WritePoint does not always return error if influx not reachable #235
Comments
@jo-me, thanks for using this library. client := influxdb2.NewClientWithOptions(serverURL, authToken, influxdb2.DefaultOptions().SetLogLevel(log.DebugLevel)) After a failed write, the batch is put to the retry queue. Retry strategy uses exponential retry time when a server doesn't send info about a suggested retry time. The first interval is 5s, then 25s, and finally 125s. The maximum number of retries is 3. If another write comes during the retry wait time, the batch is put to the retry queue and no error is returned. |
The behavior you describe would fit to the non-blocking write operation. |
I am also noticing this behaviour, and like @jo-me I would expect the blocking write API to return an error immediately instead of attempting an implicit deferred retry. As a work-around for this, I am tempted to |
For information, I have created PR #237 which should allow this work-around to be used. |
Thanks for your feedback, @jo-me , @DaveHasteSpringer . I've discussed this also internally and I will remove retry logic from the blocking write. |
Hi,
I noticed that the WriteAPIBlocking gives inconsistent return values when InfluxDB is not reachable.
When testing out the app behavior when Influx is not running, I noticed that some write attempts yield errors but many run through as if they worked fine (err==nil).
In my case I'm writing concurrently from 3 separate go routines (about 3 points each per second) calling a function with the code below. According to issues/docs the WriteAPIBlocking should be thread-safe.
Any ideas what could be the issue?
The code in questions is based on the basic blocking write example
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
Expected behavior:
a not reachable influxdb should consistently produce errors on write
Actual behavior:
err is sometimes nil
Specifications:
The text was updated successfully, but these errors were encountered: