Skip to content

Commit 917d760

Browse files
committed
JAVA-458: Fixed regression which caused nodes not in the seed list to be ignored until the second round of calls to isMaster. This could result in not finding the primary for > 5s if the primary didn't happen to be in the seed list
1 parent be9840c commit 917d760

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/com/mongodb/ReplicaSetStatus.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,8 @@ public long getNextResolveTime() {
704704
public synchronized void updateAll(){
705705
HashSet<UpdatableNode> seenNodes = new HashSet<UpdatableNode>();
706706

707-
// make a copy of _all, since UpdatableNode.update can add to it
708-
for (UpdatableNode node : new ArrayList<UpdatableNode>(_all)) {
709-
node.update(seenNodes);
707+
for (int i = 0; i < _all.size(); i++) {
708+
_all.get(i).update(seenNodes);
710709
}
711710

712711
if (seenNodes.size() > 0) {

0 commit comments

Comments
 (0)