-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 operation identifier to retry logs. #1112
Conversation
@vbabanin Is the PR a draft because you had been waiting for the tests to pass? |
? format("Retrying the operation due to the error \"%s\"; attempt #%d", exception, oneBasedAttempt) | ||
: format("Retrying the operation '%s' due to the error \"%s\"; attempt #%d", | ||
commandDescription, exception, oneBasedAttempt)); | ||
? format("Retrying the operation due to the error \"%s\"; attempt #%d; operation ID %s", exception, oneBasedAttempt, operationId) |
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.
Let's make the message a bit more similar in structure/style to what's in https://github.com/mongodb/specifications/blob/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst#command-started-message. We typically try to use complete sentences, for instance, rather than weird punctuation.
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.
Thanks for the suggestion, i have made the necessary changes to align with the recommended style.
|
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!
This PR adds logging of the
OperationContext
object to theCommandOperationHelper.logRetryExecute()
method. TheOperationContext
object provides context information about the operation being executed, such as the operation id.Logging the
OperationContext
object can be useful for troubleshooting, as it allows us to track the execution of specific operations.JAVA-4939