From d711d75d53edee739c66b0dcfaf8192894ef2bae Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Sun, 7 Jan 2018 11:22:19 +0000 Subject: [PATCH] auth: prevent constant reauthentication Since the credential handling refactor in #61, acquired session credentials are dropped after every query. This issue became apparent when testing using SCAM-SHA1 authentication for a mgo release. --- socket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket.go b/socket.go index f739baf9c..f9c63cffd 100644 --- a/socket.go +++ b/socket.go @@ -321,8 +321,8 @@ func (socket *mongoSocket) Release() { server := socket.server closeAfterIdle := socket.closeAfterIdle socket.Unlock() - socket.LogoutAll() if closeAfterIdle { + socket.LogoutAll() socket.Close() } else if server != nil { // If the socket is dead server is nil.