Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-10678

Socket constructor should not throw when the provided FD is closed already.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: 2.5.2
    • Component/s: None
    • Labels:
      None
    • ALL

      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.

            Assignee:
            schwerin@mongodb.com Andy Schwerin
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: