Skip to content

Commit

Permalink
Fixed CSHARP-204. The patch supplied with the bug report made sense t…
Browse files Browse the repository at this point in the history
…o me. Thanks to Miguel Pilar for the patch.
  • Loading branch information
rstam committed Jun 6, 2011
1 parent acab8e1 commit 1d2b1b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Driver/Core/MongoServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,11 @@ bool slaveOk
}
}

var serverInstance = GetServerInstance(slaveOk);
return serverInstance.AcquireConnection(database);
// get lock so serverInstance doesn't get disconnected before AcquireConnection is called
lock (serverLock) {
var serverInstance = GetServerInstance(slaveOk);
return serverInstance.AcquireConnection(database);
}
}

internal MongoConnection AcquireConnection(
Expand Down

0 comments on commit 1d2b1b9

Please sign in to comment.