Skip to content

Commit 56f05b4

Browse files
author
Konstantinos Tsanaktsidis
authored
Merge pull request globalsign#1 from dvic/fix_dial_deadlock
Make run on socket helper methods private
2 parents 53400c9 + 6474164 commit 56f05b4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (cluster *mongoCluster) isMaster(socket *mongoSocket, result *isMasterResul
181181
})
182182
})
183183

184-
err := session.RunOnSocket(socket, cmd, result)
184+
err := session.runOnSocket(socket, cmd, result)
185185
session.Close()
186186
return err
187187
}

session.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,10 @@ func (db *Database) Run(cmd interface{}, result interface{}) error {
848848
return db.run(socket, cmd, result)
849849
}
850850

851-
// RunOnSocket does the same as Run, but guarantees that your command will be run
851+
// runOnSocket does the same as Run, but guarantees that your command will be run
852852
// on the provided socket instance; if it's unhealthy, you will receive the error
853853
// from it.
854-
func (db *Database) RunOnSocket(socket *mongoSocket, cmd interface{}, result interface{}) error {
854+
func (db *Database) runOnSocket(socket *mongoSocket, cmd interface{}, result interface{}) error {
855855
socket.Acquire()
856856
defer socket.Release()
857857
return db.run(socket, cmd, result)
@@ -2321,11 +2321,11 @@ func (s *Session) Run(cmd interface{}, result interface{}) error {
23212321
return s.DB("admin").Run(cmd, result)
23222322
}
23232323

2324-
// RunOnSocket does the same as Run, but guarantees that your command will be run
2324+
// runOnSocket does the same as Run, but guarantees that your command will be run
23252325
// on the provided socket instance; if it's unhealthy, you will receive the error
23262326
// from it.
2327-
func (s *Session) RunOnSocket(socket *mongoSocket, cmd interface{}, result interface{}) error {
2328-
return s.DB("admin").RunOnSocket(socket, cmd, result)
2327+
func (s *Session) runOnSocket(socket *mongoSocket, cmd interface{}, result interface{}) error {
2328+
return s.DB("admin").runOnSocket(socket, cmd, result)
23292329
}
23302330

23312331
// SelectServers restricts communication to servers configured with the

0 commit comments

Comments
 (0)