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

Connection count is not in sync with the connection thread name

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.1.2
    • 2.0.2, 2.1.0
    • Networking
    • None
    • Ubuntu Linux x64, MacOS 10.7.3; likely all posix systems
    • ALL

    Description

      When mongod accepts a new connection, it prints out a counter, spawns a thread, and then the new thread prints a similar counter. Because spawning a thread is an asynchronous operation, there's no guarantee the new thread will start in the time it takes to accept new connections and spawn another thread.

      So essentially

      connection accepted from 1.2.3.4:5678 #123

      is saying 1.2.3.4:5678 established the 123rd connection.

      [conn120] end connection 1.2.3.4:5678

      is saying 1.2.3.4:5678 was being handled by the 120th thread to execute.

      It's useful for users to know when a connection was accepted, when it did something worth logging, and when the connection ended. I would propose moving the initial 'connection accepted' log message to the connection thread (after the call to setThreadName()) to ensure both counters are in sync.

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            benjamin.becker Ben Becker
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: