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

Refactor CollectionBulkLoaderImpl to not hold locks as members

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.2.0-rc0
    • None
    • Fully Compatible
    • Execution Team 2022-10-03

    Description

      As part of SERVER-57432 we discovered that the class itself is using the locks in an unconventional fashion that can lead to confusion by thinking it holds a lock in MODE_IX while actually having a MODE_X lock. What's more, the underlying code requires the lock to be MODE_X.

      The confusion stems from the fact it treats locks as movable entities when they are meant to only be used within scopes, releasing themselves when they leave it. The class instead obtains a lock during construction and releases it only when it goes out of scope, even though it gets called during different times for the various stages.

      As a result we should cleanup the method so that it acquires the lock in each method instead of assuming a lock during the entire lifetime of the object.

      Attachments

        Issue Links

          Activity

            People

              jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
              jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: