Coverity: suppress RAII destructor false positives with coverity[missing_lock]

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      What

      Add `// coverity[missing_lock]` suppression comments at the lines Coverity flags in files that use RAII lock guards (`ClientLock`, `stdx::unique_lock`, or similar wrappers) where the destructor releases the lock.

      Files: `kill_sessions_local.cpp` (lines 124, 163, 210, 267), `transaction_participant.cpp` (lines 1942, 2597, 2625), `transaction_oplog_application.cpp` (lines 400, 457), `txn_cmds.cpp` (line 270), `oplog.cpp` (lines 1203, 1254), `topology_version_observer.cpp` (line 97), `replication_coordinator_impl.cpp` (line 914), `backup_file_cloner.cpp` (lines 118, 130), `initial_syncer.cpp` (line 1108), `session_catalog_mongod_transaction_interface_impl.cpp` (line 97), `file_copy_based_initial_syncer.cpp` (line 931).

      Resolves: SERVER-110242, SERVER-119132, SERVER-111000, SERVER-110998, SERVER-110999, SERVER-110589, SERVER-110594, SERVER-110595, SERVER-110996, SERVER-110590, SERVER-111001, SERVER-111995, SERVER-110692, SERVER-109142, SERVER-108710, SERVER-108714, SERVER-108718, SERVER-117048, SERVER-108636

      Why

      Coverity's inter-procedural model cannot trace lock release through a C++ destructor, so it incorrectly reports these as missing-lock. The production code is correct. Because Coverity cannot be run locally, the annotation is also the clearest signal to a future reviewer that this finding has been deliberately evaluated and dismissed.

            Assignee:
            Unassigned
            Reporter:
            Denis Trailin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: