-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
The origin of this option is a little ambiguous, but there isn't really a valid use case for it that doesn't cause greater issues than it solves. No one has ever asked for this functionality, its just been part of our authentication code path since the very beginning.
"I want to authenticate and login to MongoDB, but then I want the driver to immediately forget about it so that everything will be completely ruined when a problem occurs and I need to reconnect." No One Ever
There are two main problems here when save_auth is disabled:
- The driver loses its ability to reconnect automatically in the event of a failover or a dirty socket instance. This is the largest problem with this
bugfeature. - We don't have any way to reliably tell which credential sets have been applied to any given socket. This complicates things like logout which on some versions of MongoDB raises an error if you logout when you're not already logged in or vice versa.
To resolve this, I'm going to be deprecating the save_auth option with our next release. We'll keep the API intact, but disabling save_auth will no longer have any effect on what we do underneath the hood.