Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60823

runCommandWithRetries in JS test framework exceeds JS interpreter recursion limit

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc17
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • v8.0, v7.0, v6.0, v5.0
    • Execution Team 2021-11-29, Execution Team 2021-12-13, Execution Team 2022-01-24, QO 2024-07-08, QO 2024-07-22, QO 2024-08-05, QO 2024-08-19
    • 200

      In some of our CI suites, the command invocation in tests is overridden to support retries. For some multi-document passthroughs, when there is a need to retry a transaction, the runCommandWithRetries() logic in implicitly_retry_on_background_op_in_progress.js and network_error_and_txn_override.js implicitly recurses into itself with the following repeating stack of function calls. This has the potential to exceed the internal recursion limit in the JS interpreter, leading to the test terminating early.

      [multi_stmt_txn_passthrough:orp] retryEntireTransaction@jstests/libs/override_methods/network_error_and_txn_override.js:690:15
      [multi_stmt_txn_passthrough:orp] retryWithTxnOverride@jstests/libs/override_methods/network_error_and_txn_override.js:753:15
      [multi_stmt_txn_passthrough:orp] runCommandOverrideBody@jstests/libs/override_methods/network_error_and_txn_override.js:1032:23
      [multi_stmt_txn_passthrough:orp] runCommandOverride@jstests/libs/override_methods/network_error_and_txn_override.js:1101:21
      [multi_stmt_txn_passthrough:orp] overrideRunCommand/Mongo.prototype.runCommand@jstests/libs/override_methods/override_helpers.js:81:20
      [multi_stmt_txn_passthrough:orp] runCommandWithRetries/<@jstests/libs/override_methods/implicitly_retry_on_background_op_in_progress.js:58:19
      [multi_stmt_txn_passthrough:orp] assert.soon@src/mongo/shell/assert.js:366:21
      [multi_stmt_txn_passthrough:orp] runCommandWithRetries@jstests/libs/override_methods/implicitly_retry_on_background_op_in_progress.js:54:5
      [multi_stmt_txn_passthrough:orp] overrideRunCommand/Mongo.prototype.runCommand@jstests/libs/override_methods/override_helpers.js:81:20
      [multi_stmt_txn_passthrough:orp] runClientFunctionWithRetries@src/mongo/shell/session.js:371:27
      [multi_stmt_txn_passthrough:orp] runCommand@src/mongo/shell/session.js:466:25
      [multi_stmt_txn_passthrough:orp] DB.prototype._runCommandImpl@src/mongo/shell/db.js:155:12
      [multi_stmt_txn_passthrough:orp] DB.prototype.runCommand@src/mongo/shell/db.js:170:16
      [multi_stmt_txn_passthrough:orp] retryEntireTransaction@jstests/libs/override_methods/network_error_and_txn_override.js:690:15
      [multi_stmt_txn_passthrough:orp] retryWithTxnOverride@jstests/libs/override_methods/network_error_and_txn_override.js:753:15
      [multi_stmt_txn_passthrough:orp] runCommandOverrideBody@jstests/libs/override_methods/network_error_and_txn_override.js:1032:23
      [multi_stmt_txn_passthrough:orp] runCommandOverride@jstests/libs/override_methods/network_error_and_txn_override.js:1101:21
      [multi_stmt_txn_passthrough:orp] overrideRunCommand/Mongo.prototype.runCommand@jstests/libs/override_methods/override_helpers.js:81:20
      [multi_stmt_txn_passthrough:orp] runCommandWithRetries/<@jstests/libs/override_methods/implicitly_retry_on_background_op_in_progress.js:58:19
      [multi_stmt_txn_passthrough:orp] assert.soon@src/mongo/shell/assert.js:366:21
      [multi_stmt_txn_passthrough:orp] runCommandWithRetries@jstests/libs/override_methods/implicitly_retry_on_background_op_in_progress.js:54:5
      
      

            Assignee:
            james.harrison@mongodb.com James Harrison
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: