Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Nov 17, 2023
1 parent 78e4d2c commit 6272457
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x/mongo/driver/topology/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,8 @@ func (c *connection) close() error {

func (c *connection) closeWithErr(err error) error {
c.err = err
c.closeConnectContext()
c.wait() // Make sure that the connection has finished connecting.
return c.close()
}

Expand Down

0 comments on commit 6272457

Please sign in to comment.