Skip to content

Commit c4a4d7c

Browse files
committed
JAVA-793: Fixed race condition in DBTCPConnector.authenticate by putting in a call to checkMaster prior to getting a DBPort to authenticate on.
1 parent 4b0c612 commit c4a4d7c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/com/mongodb/DBTCPConnector.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ public boolean isOpen(){
614614

615615
@Override
616616
public CommandResult authenticate(MongoCredential credentials) {
617+
checkMaster(false, true);
617618
final DBPort port = _myPort.get(false, ReadPreference.primaryPreferred(), null);
618619

619620
try {

0 commit comments

Comments
 (0)