We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6125995 commit a6e3ce4Copy full SHA for a6e3ce4
src/main/com/mongodb/ReplicaSetStatus.java
@@ -285,11 +285,14 @@ synchronized void updateAll(){
285
n.update(seenNodes);
286
}
287
288
- // remove unused hosts
289
- Iterator<Node> it = _all.iterator();
290
- while (it.hasNext()) {
291
- if (!seenNodes.contains(it.next()))
292
- it.remove();
+ if (!seenNodes.isEmpty()) {
+ // not empty, means that at least 1 server gave node list
+ // remove unused hosts
+ Iterator<Node> it = _all.iterator();
+ while (it.hasNext()) {
293
+ if (!seenNodes.contains(it.next()))
294
+ it.remove();
295
+ }
296
297
298
0 commit comments