[SERVER-76640] Latch analyzer complains theoretical deadlock with SingleServerDiscoveryMonitor Created: 28/Apr/23  Updated: 11/May/23  Resolved: 11/May/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: [DO NOT USE] Backlog - Sharding NYC
Resolution: Won't Fix Votes: 0
Labels: sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding NYC
Operating System: ALL
Participants:

 Description   

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.


Generated at Thu Feb 08 06:33:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.