Coverity analysis defect 176595: Value not atomically updated

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Networking & Observability
    • ALL
    • N&O 2025-09-15
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Value not atomically updated

      The result of the update will be determined by the interleaving of thread execution. Non-atomic update of a concurrently shared value
      /src/mongo/client/connection_pool.cpp:163: ATOMICITY 176595 Locking "lk".
      /src/mongo/client/connection_pool.cpp:146: ATOMICITY 176595 Assigning data that might be protected by the lock to "candidate".
      /src/mongo/client/connection_pool.cpp:147: ATOMICITY 176595 Unlocking "lk". "candidate" might now be unreliable because other threads can now change the data that it depends on.
      /src/mongo/client/connection_pool.cpp:163: ATOMICITY 176595 Locking "lk" again.
      /src/mongo/client/connection_pool.cpp:164: ATOMICITY 176595 Using an unreliable value of "candidate" inside the second locked section. If the data that "candidate" depends on was changed by another thread, this use might be incorrect.

            Assignee:
            Sergei Bazhenov
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: