You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/transactions-convenient-api/tests/README.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,23 +29,20 @@ Write a callback that returns a custom value (e.g. boolean, string, object). Exe
29
29
Drivers should test that `withTransaction` enforces a non-configurable timeout before retrying both commits and entire
30
30
transactions. Specifically, three cases should be checked:
31
31
32
-
- If the callback raises an error with the TransientTransactionError label and the retry timeout has been exceeded,
33
-
`withTransaction` should propagate the error (see Note 1 below) to its caller.
32
+
- If the callback raises an error with the `TransientTransactionError` label and the retry timeout has been exceeded,
33
+
`withTransaction` should propagate the error as described in the [propagation mechanism](../transactions-convenient-api.md#timeout-error-propagation-mechanism) below) to its caller.
34
34
- If committing raises an error with the UnknownTransactionCommitResult label, and the retry timeout has been exceeded,
35
-
`withTransaction` should propagate the error (see Note 1 below) to its caller.
35
+
`withTransaction` should propagate the error as described in the [propagation mechanism](../transactions-convenient-api.md#timeout-error-propagation-mechanism) to its caller.
36
36
- If committing raises an error with the TransientTransactionError label and the retry timeout has been exceeded,
37
-
`withTransaction` should propagate the error (see Note 1 below) to its caller. This case may occur if the commit was
38
-
internally retried against a new primary after a failover and the second primary returned a NoSuchTransaction error
37
+
`withTransaction` should propagate the error as described in the [propagation mechanism](../transactions-convenient-api.md#timeout-error-propagation-mechanism) to its caller. This case may occur if the commit was
38
+
internally retried against a new primary after a failover and the second primary returned a `NoSuchTransaction` error
39
39
response.
40
40
41
41
If possible, drivers should implement these tests without requiring the test runner to block for the full duration of
42
42
the retry timeout. This might be done by internally modifying the timeout value used by `withTransaction` with some
Copy file name to clipboardExpand all lines: source/transactions-convenient-api/transactions-convenient-api.md
+23-11Lines changed: 23 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ This method should perform the following sequence of actions:
123
123
124
124
2. If `transactionAttempt` > 0:
125
125
126
-
1. If elapsed time + `backoffMS` > `TIMEOUT_MS`, then raise the previously encountered error (see Note 1 below). If
126
+
1. If elapsed time + `backoffMS` > `TIMEOUT_MS`, then propagate the previously encountered error (see [propagation section](transactions-convenient-api.md#timeout-error-propagation-mechanism) below). If
127
127
the elapsed time of `withTransaction` is less than TIMEOUT_MS, calculate the backoffMS to be
@@ -163,7 +163,7 @@ This method should perform the following sequence of actions:
163
163
committed a transaction, propagate the callback's error to the caller of `withTransaction` and return
164
164
immediately.
165
165
166
-
4. Otherwise, propagate the callback's error (see Note 1 below) to the caller of `withTransaction` and return
166
+
4. Otherwise, propagate the callback's error (see [propagation section](transactions-convenient-api.md#timeout-error-propagation-mechanism) below) to the caller of `withTransaction` and return
167
167
immediately.
168
168
169
169
8. If the ClientSession is in the "no transaction", "transaction aborted", or "transaction committed" state, assume the
@@ -180,20 +180,19 @@ This method should perform the following sequence of actions:
180
180
181
181
2. If the `commitTransaction` error includes a "TransientTransactionError" label, jump back to step two.
182
182
183
-
3. Otherwise, propagate the `commitTransaction` error (see Note 1 below) to the caller of `withTransaction` and
183
+
3. Otherwise, propagate the `commitTransaction` error (see [propagation section](transactions-convenient-api.md#timeout-error-propagation-mechanism) below) to the caller of `withTransaction` and
184
184
return immediately.
185
185
186
186
11. The transaction was committed successfully. Return immediately.
0 commit comments