-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add backoff support to the redis output #7781
Conversation
We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few typos in the comments to fix.
libbeat/outputs/redis/backoff.go
Outdated
|
||
// failReason is used to track the cause of an error. | ||
// The redis client forces us to reconnect on any error (even for redis | ||
// internal errors). The backoff timer must not be reset on a successfully |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/successfully/successful
libbeat/outputs/redis/backoff.go
Outdated
// failReason is used to track the cause of an error. | ||
// The redis client forces us to reconnect on any error (even for redis | ||
// internal errors). The backoff timer must not be reset on a successfully | ||
// reconnect after publishing failed with a redis internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double space between 'with' and 'a'
libbeat/outputs/redis/backoff.go
Outdated
// give the client a chance to promote an internal error to a network error. | ||
b.updateFailReason(err) | ||
b.backoff.Wait() | ||
} else if b.reason != failRedis { // Only reset backoff durartion if failure was due to IO errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/durartion/duration
* Add custom backoff support to redis client We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit eaf516a)
* Add custom backoff support to redis client We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit eaf516a)
Cherry-pick #7781 to 6.4: Add backoff support to the redis output
Cherry-pick #7781 to 6.x: Add backoff support to the redis output
This PR need a 6.3 backport. |
* Add custom backoff support to redis client We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit eaf516a)
We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit eaf516a)
We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit 1415dc1)
* Add custom backoff support to redis client We are forced to reconnect to redis on error. Even for redis internal errors. The custom backoff client wrapper detects if the error has been an redis internal error, or any other kind of error. If the actual error comes from redis, a reconnect should reset the backoff timer. The backoff client wrapper makes sure that the backoff timer is only reset after a successfull publish. In case of IO errors during connect (without having published any event yet), we track these as `failOther`. A successfull connect will reset the backoff timer. (cherry picked from commit 1415dc1)
Cherry-pick elastic#7781 to 6.4: Add backoff support to the redis output
The PR adds backoff support to the redis output, similar to the Elasticsearch/Logstash output. 2 Settings
backoff.init
andbackoff.max
are available. On failure we will wait forbackoff.init
before trying to reconnect. If reconnect fails, the wait times increase exponentially. Thebackoff.max
configures the maximum duration until retry.We are forced to reconnect to redis on error. Even for redis internal
errors. The custom backoff client wrapper detects if the error has been
an redis internal error, or any other kind of error. If the actual error
comes from redis, a reconnect must not reset the backoff timer. The
backoff client wrapper makes sure that the backoff timer is only reset
after a successfull publish.
In case of IO errors during connect (without having published any event
yet), we track these as
failOther
. A successfull connect will resetthe backoff timer.