Skip to content

Commit

Permalink
auth: prevent constant reauthentication
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
domodwyer committed Jan 7, 2018
1 parent a104bfb commit d711d75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d711d75

Please sign in to comment.