Report a failing sink, and back off a collection that keeps failing - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs found by running the keygrabber against a real peer and a dead InfluxDB, while writing the hispec deployment config (hispec#216). Both are in failure handling, which is exactly what the unit tests were not exercising.
isconnectedreported healthy while every write failed. Observed on a live daemon:queuedepth=25,pointswritten=0, and yetisconnected=True,writeerrors=0,lasterror=None. An operator would have seen a healthy archiver writing nothing.The cause is a seam between two pieces that are each correct alone.
RetryingWriter.writecatchesSinkWriteError, queues the batch and returns 0, which is what makes retrying possible; so the daemon'sexcept LibbyErrornever fired and it set_sink_healthy = Trueregardless.RetryingWriternow exposeshealthyandfailed_attempts, with a docstring saying why a caller cannot learn this from an exceptionwriteerrorsnow counts every failed attempt including retriesA failing collection had no backoff. It logged an error every interval indefinitely, which the design called for avoiding. Measured before: twelve error lines in six seconds at a 0.5s cadence, forever, each one also rewriting
lasterror.Both symptoms are now regression tests. The dead-sink one asserts through the control keywords over both transports, which is how the bug presented; the backoff ones run against a fake clock. 240 tests, pylint 10.00/10,
-Wdocs build verified, and the docs now say how a failing sink looks acrossisconnected,queuedepthandpointswrittentogether.