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

implicitly_retry_on_database_drop_pending.js calls tojson() inside of a loop

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.2, 3.7.1
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      TIG 2018-1-15
    • Linked BF Score:
      0

      Description

      Depending on the number of write errors in the server's response, we may spend >10 minutes in the for-loop to filter out successful write operations due to serializing the server's response as a JSON string. This leads to the assert.soon() timeout expiring without actually ever being able to perform a single retry.

      // We filter out operations that didn't produce a write error to avoid causing a
      // duplicate key error when retrying the operations.
      for (let writeError of res.writeErrors) {
          assert.lt(writeError.index,
                    opsExecuted.length,
                    "A write error was returned for an operation outside the list" +
                        " of operations executed: " + tojson(res));
          opsToRetry.push(opsExecuted[writeError.index]);
      }
      

      We should change the way the assertion is written to avoid calling tojson(res) so many times.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              max.hirschhorn Max Hirschhorn
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: