|
See the following for an example, on Windows:
http://buildlogs.mongodb.org/Windows%2064-bit/builds/5680/test/sharding/read_pref.js
In essence, there is a race between the Socket constructor and the networking stack. If the far side of a network connection disconnects between the return of the accept or connect OS calls and the completion of the Socket constructor which is passed the FD returned by those calls, the resolution of the local address on the socket will fail. Right now, this masserts(), but error handling in initAndListen is not prepared for an exception here. It would be acceptable in the current architecture to simply log a warning, and know that future operations on the socket will fail because it has been disconnected.
|