PYTHON-5695 Clarify NoWritesPerformed error label behavior when multiple retries occur#2707
Conversation
| # code `91` (NotWritablePrimary) and the `NoWritesPerformed`, `RetryableError` and `SystemOverloadedError` labels. | ||
| command_args_inner = { | ||
| "configureFailPoint": "failCommand", | ||
| "mode": "alwaysOn", |
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
Can you describe the change you had to make?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
The self.async_rs_client() call already performs self.addAsyncCleanup(client.close) before returning the client.
| listener.failed = failed | ||
|
|
||
| client = await self.async_rs_client(retryWrites=True, event_listeners=[listener]) | ||
| self.addAsyncCleanup(client.close) |
There was a problem hiding this comment.
Also done, for all three tests
PYTHON-5695
Changes in this PR
Add prose tests to verify the handling of the
NoWritesPerformederror label behavior when multiple retries occur.Test Plan
Standard tests.
Checklist
Checklist for Author
Checklist for Reviewer