Skip to content

Conversation

NoahStapp
Copy link
Contributor

No description provided.

@NoahStapp NoahStapp requested a review from ShaneHarvey March 31, 2025 20:06
if self._retrying:
_debug_log(
_COMMAND_LOGGER,
message=f"Retrying write attempt number {self._attempt_number}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any fields we should add here that can be used to correlate the two retry attempts? Maybe _operation and/or _operation_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With those fields added, this is what the message looks like:

{"message": "Retrying read attempt number <x> for operation 'op_name' with id <id>}"}

@NoahStapp NoahStapp requested a review from ShaneHarvey April 1, 2025 13:10
_debug_log(
_COMMAND_LOGGER,
message=f"Retrying write attempt number {self._attempt_number}",
message=f"Retrying write attempt number {self._attempt_number} for operation `{self._operation}` with id {self._operation_id}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the logging format:

                    _debug_log(
                        _COMMAND_LOGGER,
                        message=f"Retrying write attempt number {self._attempt_number}",
                        clientId=...,
                        commandName=self._operation,
                        operationId=self._operation_id

@NoahStapp NoahStapp requested a review from ShaneHarvey April 1, 2025 17:22
@NoahStapp NoahStapp merged commit 3210b17 into mongodb:master Apr 2, 2025
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants