-
Notifications
You must be signed in to change notification settings - Fork 0
database,redis: More verbosity in OnRetryableError #124
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
Conversation
Removing "retry deadline exceeded" from the error message also results in more useful error messages for users. Take Icinga/icingadb#900 for an example. |
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.
retry.WithBackoff: Reduce error wrapping
...
But this additional layer does not really carry any useful information.
This helps to easily distinguish non-retryable from "timeout" errors.
Removing "retry deadline exceeded" from the error message also results in more useful error messages for users. Take Icinga/icingadb#900 for an example.
That's a different "retry deadline exceeded" error:
https://github.com/Icinga/icingadb/blob/main/pkg/icingadb/ha.go#L166
That doesn't mean that I don't want to change anything but I'm not a fan of just removing the wrapping. The ha:166
error could get more context, a more understandable message or whatever. And if wrapping is such a problem, I would change the renderer, output the error messages first and then the stack trace(s).
database/redis: More verbosity in OnRetryableError
...
The changed version always logs the reoccurring error and also includes
the duration since the start and the current attempt.
If I am not mistaken, this leads to a large number of error messages in the first few seconds, as there is not much time between retries. Can this be optimized, for example, to only log every after at least 10 seconds if the error message has not changed?
Fair enough. I just dislike having another entry in the stack trace carrying the position of this wrapping. I am going to remove this.
You are totally right. I have successfully confused myself.
Yes, this results in more WARNING log entries but this was my intention. IMO, if something is broken, it should be shown and not hidden. The current behavior only shows an error once, hiding it for up to five minutes before crashing. The suggested behavior would always show the error, resulting in a few entries recurring entries at first - but only if the error is not recovered directly. |
The OnRetryableError functions came with conditions to only log the error if it had changed since the last iteration. While this keeps the log file clean, it hides reoccurring errors and makes it harder to identify specific errors. The changed version always logs the reoccurring error and also includes the duration since the start and the current attempt.
I completely understand your point. The wrapping helps us to understand errors better, but it can be confusing for users since the messages end up on multiple lines. But as I said, I think we can improve this by adjusting how we render the errors.
I thought the log gets cluttered because of the frequent retries in the first few seconds, but there are only six messages in the first 10 seconds, so that's perfectly fine:
|
Uh oh!
There was an error while loading. Please reload this page.