Skip to content

Commit

Permalink
Merge pull request globalsign#1 from dvic/fix_dial_deadlock
Browse files Browse the repository at this point in the history
Make run on socket helper methods private
  • Loading branch information
KJTsanaktsidis authored Mar 22, 2018
2 parents 53400c9 + 6474164 commit 56f05b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (cluster *mongoCluster) isMaster(socket *mongoSocket, result *isMasterResul
})
})

err := session.RunOnSocket(socket, cmd, result)
err := session.runOnSocket(socket, cmd, result)
session.Close()
return err
}
Expand Down
10 changes: 5 additions & 5 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,10 +848,10 @@ func (db *Database) Run(cmd interface{}, result interface{}) error {
return db.run(socket, cmd, result)
}

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

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

// SelectServers restricts communication to servers configured with the
Expand Down

0 comments on commit 56f05b4

Please sign in to comment.