-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.0
-
Component/s: None
-
None
BsonBuffer.LoadFrom contains the following loop:
while (bytesPending > 0) {
var bytesRead = stream.Read(localChunk, localChunkOffset, bytesPending);
if (bytesRead == 0)
else
{ localChunkOffset += bytesRead; bytesPending -= bytesRead; }}
The "timeout" is a necessity here, since when the connection is gracefully closed from the MongoDB side (by stopping the server), the client connection remains active:
netstat -a -n | find ":27017"
TCP client:5171 mongodb:27017 CLOSE_WAIT
This leads to an endless loop that just hangs the client thread when the server is gone.