(commitError: Error)
| 941 | ]); |
| 942 | |
| 943 | function shouldUnpinAfterCommitError(commitError: Error) { |
| 944 | if (commitError instanceof MongoError) { |
| 945 | if ( |
| 946 | isRetryableWriteError(commitError) || |
| 947 | commitError instanceof MongoWriteConcernError || |
| 948 | isMaxTimeMSExpiredError(commitError) |
| 949 | ) { |
| 950 | if (isUnknownTransactionCommitResult(commitError)) { |
| 951 | // per txns spec, must unpin session in this case |
| 952 | return true; |
| 953 | } |
| 954 | } else if (commitError.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { |
| 955 | return true; |
| 956 | } |
| 957 | } |
| 958 | return false; |
| 959 | } |
| 960 | |
| 961 | function shouldAddUnknownTransactionCommitResultLabel(commitError: MongoError) { |
| 962 | let ok = isRetryableWriteError(commitError); |
no test coverage detected