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

ListeningSockets::closeAll should not cause an invariant if we are not inShutdown

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.4
    • Affects Version/s: None
    • Component/s: Networking
    • None
    • Fully Compatible
    • ALL
    • Hide

      Run scoped_db_conn_test on Windows.

      Run scoped_db_conn_test on Windows.
    • Platforms 12 (04/01/16)
    • 0

      On linux, if the listen socket is closed and we get an error from select, we just let the thread driving the Listener fall out of the loop in Listener::initAndListen:


      But, on Windows, if we find that the listening socket has closed, we fassertFailed.

      This means that on Windows, it is impossible to get the thread out of initAndListen without terminating the process via fassertFailed without first calling shutdown().

      This makes it hard to write reasonable tests that need to use a listener, like scoped_db_conn_test. We can't call shutdown or shutdownNoTerminate because after that happens, we are always in a shutdown state and can't start a new listener.

      The Windows version of initAndListen should work more like the non-windows version: if WSAEventSelect fails, and we are not in shutdown, log an error and let the thread return. If we are in shutdown, just return.


            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            0 Vote for this issue
            2 Start watching this issue