Standardize SharedPromise usage and add Coverity suppression

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Coverity

      There have been 61 missing_lock coverity errors, most around SharedPromise usage.

      In SERVER-119208, Coverity is describing a pattern of fulfilling a SharedFuture while holding an exclusive lock, but retrieving a SharedFuture without holding a lock.

      SharedPromise

      Per the SharedPromise class documentation:

      Any number of threads can extract a future at the same time. It is also safe to extract a future concurrently with completing the promise.

      This was confirmed in a thread in #server-programmability.

      Basically, get() and getFuture() are safe, the reads and writes to promise or future themselves may need external synchronization.

      Proposal

      To standardize our SharedPromise usage, all occurrences that lock on a getFuture call should be changed to remove the lock_guard.

      To prevent future Coverity issues, a Coverity suppression should be added for all getFuture usages.

            Assignee:
            Jordan Glassley
            Reporter:
            Jordan Glassley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: