Skip to content

Commit 188ac8e

Browse files
DRIVERS-1815 Add TransientTransactionError label to PoolClearedError (#1707)
1 parent 22f068a commit 188ac8e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

source/transactions/tests/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ driver, use command monitoring instead.
7373
assert len(addresses) > 1
7474
```
7575

76+
3. Test that `PoolClearedError` has `TransientTransactionError` label. Since there is no simple way to trigger
77+
`PoolClearedError`, this test should be implemented in a way that suites each driver the best.
78+
7679
## Changelog
7780

81+
- 2024-10-31: Add test for PoolClearedError.
7882
- 2024-02-15: Migrated from reStructuredText to Markdown.
7983
- 2024-02-07: Converted legacy transaction tests to unified format and moved the legacy test format docs to a separate
8084
file.

source/transactions/transactions.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ string error labels. Drivers may also add error labels to errors that they retur
6464

6565
#### Transient Transaction Error
6666

67-
Any command or network error that includes the "TransientTransactionError" error label in the "errorLabels" field.
67+
Any command, network, or driver error that includes the "TransientTransactionError" error label in the "errorLabels"
68+
field.
6869

6970
### **Naming variations**
7071

@@ -673,12 +674,13 @@ string error labels.
673674

674675
### Transient Transaction Error
675676

676-
Any command error that includes the "TransientTransactionError" error label in the "errorLabels" field. Any network
677-
error or server selection error encountered running any command besides commitTransaction in a transaction. In the case
678-
of command errors, the server adds the label; in the case of network errors or server selection errors where the client
679-
receives no server reply, the client MUST add the label. If a network error occurs while running the commitTransaction
680-
command then it is not known whether the transaction committed or not, and thus the "TransientTransactionError" label
681-
MUST NOT be added.
677+
- Any command error that includes the "TransientTransactionError" error label in the "errorLabels" field. In the case of
678+
command errors, the server adds the label.
679+
- Any network error or server selection error encountered running any command besides commitTransaction in a
680+
transaction. In the case of network errors or server selection errors where the client receives no server reply, the
681+
client MUST add the label. If a network error occurs while running the commitTransaction command then it is not
682+
known whether the transaction committed or not, and thus the "TransientTransactionError" label MUST NOT be added.
683+
- `PoolClearedError`. Driver MUST add the label to this error.
682684

683685
#### Retrying transactions that fail with TransientTransactionError
684686

@@ -1071,7 +1073,7 @@ objective of avoiding duplicate commits.
10711073

10721074
## **Changelog**
10731075

1074-
- 2024-10-28: Clarify when drivers must add TransientTransactionError label.
1076+
- 2024-10-31: Clarify when drivers must add TransientTransactionError label.
10751077

10761078
- 2024-10-28: Note read preference must always be primary in a transaction.
10771079

0 commit comments

Comments
 (0)