-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Shell
-
Labels:None
-
Server Tooling & Methods
-
ALL
-
-
Service Arch 2018-10-08, Service Arch 2018-10-22, Service Arch 2018-11-05, Service Arch 2018-11-19, Service Arch 2018-12-03, Service Arch 2018-12-17, Service Arch 2018-12-31, Service Arch 2019-01-14, Service Arch 2019-01-28, Service Arch 2019-02-11, Service Arch 2019-02-25, Service Arch 2019-03-11, Service Arch 2019-03-25
When logical sessions are implicitly created in the shell, they bump the ref-count of the client that created them, so that they can end the session on the same connection. The close() method on the Mongo connection works by resetting the shared_ptr<DBClientBase> that holds the underlying C++ client. Since the implicit session now holds a copy of that shared_ptr, close() basically does nothing.
There seem to be two options:
- Have the Session object hold a weak_ptr to its DBClientBase, and lock/check the client before trying to end the session. The downside here is that the session might be finalized before the client and we'd leak the session on the server.
- Have the client keep track of its default session and end it during its finalizer.