-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.0.2, 2.1.0
-
Component/s: Networking
-
None
-
Environment:Ubuntu Linux x64, MacOS 10.7.3; likely all posix systems
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
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.