Pass retry attempt count through middlewares #254
Closed
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.
This would allow middlewares to instrument calls and retries with more granularity, as well as determine if raised errors are final or if they will be retried.
Discussed in Broken Pipe and EOFErrors #119 where users saw an increase in errors reported to DataDog that actually resulted in successful calls due to the default of 1
reconnect_attempts
in redis-rb / sidekiqThis was specifically adapted from the idea suggested in Broken Pipe and EOFErrors #119 (comment)
There would still need to be changes coordinated in DataDog/dd-trace-rb#3820 to close the initial issue (#119) but this is a generic approach that would also benefit anyone writing their own middlewares