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

Make sure random_DDL_CRUD_operations.js releases the jstest collection mutex on failure

    • Fully Compatible
    • Sharding EMEA 2021-05-17

      The random_DDL_CRUD_operations.js FSM takes a mutex to serialize drop and CRUD states on the same collection.
      If a command fails while the mutex is held, that thread will throw and never unlock the mutex. This will cause the other FSM threads to potentially wait infinitely trying to take the mutex, and eventually the test fails because of timeout. This is not desirable because:

      • The test will take a long time until it timesout. It would be better if it fails more promptly
      • It is more difficult to triage the failure, since all of them manifest as test-timeout acquiring that mutex.

      Instead, we could use a try-catch-finally block to make sure that the mutex gets unlocked even if the command fails. Here for the drop state, and here for the CRUD state

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: