Skip to content

PYTHON-5695 Clarify NoWritesPerformed error label behavior when multiple retries occur#2707

Merged
blink1073 merged 6 commits intomongodb:backpressurefrom
blink1073:PYTHON-5695
Feb 18, 2026
Merged

PYTHON-5695 Clarify NoWritesPerformed error label behavior when multiple retries occur#2707
blink1073 merged 6 commits intomongodb:backpressurefrom
blink1073:PYTHON-5695

Conversation

@blink1073
Copy link
Member

@blink1073 blink1073 commented Feb 13, 2026

PYTHON-5695

Changes in this PR

Add prose tests to verify the handling of the NoWritesPerformed error label behavior when multiple retries occur.

Test Plan

Standard tests.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@blink1073 blink1073 requested a review from a team as a code owner February 13, 2026 21:58
@blink1073 blink1073 requested review from sleepyStick and removed request for a team February 13, 2026 21:58
@blink1073 blink1073 marked this pull request as draft February 13, 2026 21:58
# code `91` (NotWritablePrimary) and the `NoWritesPerformed`, `RetryableError` and `SystemOverloadedError` labels.
command_args_inner = {
"configureFailPoint": "failCommand",
"mode": "alwaysOn",
Copy link
Member Author

Choose a reason for hiding this comment

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

@NoahStapp I had to change this from the spec because otherwise the error is never triggered (it is retried). I think this was a bug in the original spec, since I'm the first one implementing it. Should I make a PR to update the specification?

Copy link
Contributor

@NoahStapp NoahStapp Feb 17, 2026

Choose a reason for hiding this comment

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

Can you describe the change you had to make?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it was a copy-paste error. I had to change mode: {times: 1} to mode: alwaysOn for the second failCommand to ensure it failed on backpressure retries.

listener.failed = failed

client = await self.async_rs_client(retryWrites=True, event_listeners=[listener])
self.addAsyncCleanup(client.close)
Copy link
Contributor

Choose a reason for hiding this comment

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

The self.async_rs_client() call already performs self.addAsyncCleanup(client.close) before returning the client.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

listener.failed = failed

client = await self.async_rs_client(retryWrites=True, event_listeners=[listener])
self.addAsyncCleanup(client.close)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also done, for all three tests

@blink1073 blink1073 requested a review from NoahStapp February 18, 2026 13:57
@blink1073 blink1073 merged commit 1d219a9 into mongodb:backpressure Feb 18, 2026
76 of 81 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

Comments