Skip to content

Commit

Permalink
DRIVERS-2170 server info on retryable errors must reflect originating…
Browse files Browse the repository at this point in the history
… server
  • Loading branch information
jamis committed Dec 5, 2023
1 parent 13117d6 commit 59ec7d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/retryable-reads/retryable-reads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ other error originating from the server, that error should be raised instead as
the caller can infer that an attempt was made and the second error is likely
more relevant (with respect to the current topology state).

If a driver associates server information (e.g. the server address or
description) with an error, the driver MUST ensure the server information
reported with that error corresponds to the server that was selected when the
error occurred. Specifically, if a retry attempt fails, the server reported
with the error MUST correspond to the server that was selected for the retry
and MUST NOT simply be carried over from the original error.

4. Implementation constraints
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
7 changes: 7 additions & 0 deletions source/retryable-writes/retryable-writes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ from the driver) or the error is labeled "NoWritesPerformed", the error from
the previous attempt should be raised. If all server errors are labeled
"NoWritesPerformed", then the first error should be raised.

If a driver associates server information (e.g. the server address or
description) with an error, the driver MUST ensure the server information
reported with that error corresponds to the server that was selected when the
error occurred. Specifically, if a retry attempt fails, the server reported
with the error MUST correspond to the server that was selected for the retry
and MUST NOT simply be carried over from the original error.

The above rules are implemented in the following pseudo-code:

.. code-block:: typescript
Expand Down

0 comments on commit 59ec7d9

Please sign in to comment.