jstests/libs/override_methods/network_error_and_txn_override.js
// If a retry fails, returns the response, or returns null for further exception processing.
If a retry fails, returns the response, or returns null for further exception processing.
If a retry fails returns the response or returns null for further exception processing .
function retryWithTxnOverrideException(e, conn, cmdName, cmdObj, lsid, logError) {
    assert(configuredForTxnOverride());
    if (TransactionsUtil.isTransientTransactionError(e) && cmdName !== "abortTransaction") {
        logError("Retrying on TransientTransactionError exception for command");
        const res = retryEntireTransaction(conn, lsid);
        if (!hasError(res) && cmdName === "commitTransaction") {
            commitTransaction(conn, lsid, txnOptions.txnNumber);
        }
        return res;
    }
    if (configuredForNetworkRetry() && isNetworkError(e) &&
        !canRetryNetworkErrorForCommand(cmdName, cmdObj)) {
        logError("Retrying on network exception for transaction statement");
        return retryEntireTransaction(conn, lsid);
    }
    return null;
}
function retryWithTxnOverrideException ( e , conn , cmdName , cmdObj , lsid , logError ) { assert ( configuredForTxnOverride ( ) ) ; if ( TransactionsUtil . isTransientTransactionError ( e ) && cmdName !== "abortTransaction" ) { logError ( "Retrying on TransientTransactionError exception for command" ) ; const res = retryEntireTransaction ( conn , lsid ) ; if ( ! hasError ( res ) && cmdName === "commitTransaction" ) { commitTransaction ( conn , lsid , txnOptions . txnNumber ) ; } return res ; } if ( configuredForNetworkRetry ( ) && isNetworkError ( e ) && ! canRetryNetworkErrorForCommand ( cmdName , cmdObj ) ) { logError ( "Retrying on network exception for transaction statement" ) ; return retryEntireTransaction ( conn , lsid ) ; } return null ; }
If a retry fails, returns the response, or returns null for further exception processing.
If a retry fails returns the response or returns null for further exception processing .
// If we got a TransientTransactionError on 'commitTransaction' retrying the transaction // will not retry it, so we retry it here.