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

Listener::waitUntilListening may return before listening has started

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • None
    • 3.0.5, 3.1.6
    • Internal Code, Networking
    • None
    • Fully Compatible
    • ALL
    • Platform 6 07/17/15

    Description

      The waitUntilListening function uses a condition wait with a predicate based on the bool Listener::_ready. Unfortunately, this variable is not initialized in the constructor, meaning that its value is indeterminate. In the case where it is indeterminately a numeric value interpretable as 'false', callers to waitUntilListening will return immediately, before listening has actually started.

      Note that repl::isSelf depends on the proper functioning of waitUntilListening, since otherwise it may attempt to connect before the socket is listening, leading to a false negative.

      Attachments

        Activity

          People

            adam.midvidy Adam Midvidy
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: