-
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
fix(WriteAPIBlocking): properly return error from flush() #359
fix(WriteAPIBlocking): properly return error from flush() #359
Conversation
Thanks so much for the pull request! |
Codecov ReportBase: 92.36% // Head: 92.28% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #359 +/- ##
==========================================
- Coverage 92.36% 92.28% -0.09%
==========================================
Files 23 23
Lines 2227 2228 +1
==========================================
- Hits 2057 2056 -1
- Misses 130 131 +1
- Partials 40 41 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
!signed-cla |
@danielorbach, good point. Thanks for the PR! |
Pull Request influxdata#350 (commit a9c1e37) introduced `Flush()` and `Write()` functions blindly returning the result of a `func (Service) WriteBatch(...) *http2.Error`. This causes the returned error to always evaluate as `non-nil`. Fixes influxdata#360
c652561
to
0292c61
Compare
@vlastahajek Please see the updated description, related Issue (#360) and new commit (0292c61). Let me know if I should add anything else. |
@vlastahajek are you good with the update? @danielorbach would you be willing to add an entry to the change log as well? That way we can grab this for the release this week. Thanks! |
Sorry @powersj I haven't had the time to do it before this PR has been merged. |
No worries, I've already added the entry. |
Commit a9c1e37 introduced a bug, where a successful
Flush
returns a non-nil error because the internal function (w.service.WriteBatch
) returns a concrete pointer and not anerror
.Closes #360
This bug is not present without Batching because the return value of
WriteBatch()
is properly checked before returning from the functionwriteAPIBlocking.write()
. This code path is skipped by delegating the work towriteAPIBlocking.flush()
instead.Proposed Changes
check the concrete type for a
nil
pointer (of type*http2.Error
) otherwise return an explicitnil
error.Checklist