-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.4.4
-
Component/s: Networking
-
Fully Compatible
-
ALL
-
v5.0, v4.4
-
Service Arch 2021-03-22
-
(copied to CRM)
-
4
Whenever StreamableReplicaSetMonitor::getHostsOrRefresh is called (which happens on every query), if the result isn't immediately available, we enqueue a query object for that host, to be resolved when the host becomes available. As part of enqueuing a query, we unconditionally register the query processor as an event listener for topology changes. We only remove that listener when all outstanding queries are satisfied, but that won't happen as long as the node the RSM is targeting is down or unable to be contacted. Registering a listener does not do any deduplication to check whether the passed-in pointer is the same, which means the list of listeners will continue to grow as long as there are new queries. It also means that every time there's a topology change event, ALL of those listeners will then call requestImmediateCheck.
We should change it so that the RSM _queryProcessor topology listener is only registered at most once.