Latch analyzer complains theoretical deadlock with SingleServerDiscoveryMonitor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Sharding NYC
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      This and this place holds SingleServerDiscoveryMonitor::mutex lock with HierarchicalAcquisitionLevel(4), and runs SingleServerDiscoveryMonitor::_onHelloFailure() which in-turn acquires TopologyEventsPublisher::_eventQueueMutex HierarchicalAcquisitionLevel(6). This triggers latch analyzer to throw the following message in my local testing.

      "Theoretical deadlock found on use of latch","attr":{"reason":"Latch acquired after other latch of lower level","latch":{"name":"TopologyEventsPublisher::_eventQueueMutex","latchId":11027,"level":6,"file":"src/mongo/client/sdam/topology_listener.h","line":149},"latchesHeld":[{"name":"SingleServerDiscoveryMonitor::mutex","latchId":11030,"level":4,"file":"src/mongo/client/server_discovery_monitor.h","line":103}]}}
      

      It seems like a false alarm. But just passing to sharding team to do formal evaluation if that's a false alarm and can be ignored (Or) need some sort of fix.

            Assignee:
            [DO NOT USE] Backlog - Sharding NYC
            Reporter:
            Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: