Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Fully Compatible
-
Platform 5 06/26/16
Description
ClientBasic current caches information about the connected network client by holding an AbstractMessagingPort pointer. This pointer is accessed from a few places in the database layer, notably:
- src/mongo/db/auth/sasl_commands.cpp
- src/mongo/db/commands/authentication_commands.cpp
- src/mongo/db/repl/replset_commands.cpp
This couples the database implementation to details of the network implementation. Additionally, the last instance, in the replication code, makes use of the connection tagging facility, which is currently managed by a global "Ports" object instantiated inside messaging_port.cpp, which is used to implement MessagingPort::closeAllSockets.
Rather than allowing the database layer direct access to the socket types and using globals to track connections, we should create a new connection management facility, and attach it to the service context. The connection management facility would be responsible for providing database Client level access to information about the network (local and remote addresses, X509 names, etc.), and for managing tagging and global actions on connected clients.