Skip to content

Commit e8ce4ca

Browse files
committed
Fix the issue in getOrQueueForIdleConn where connectionPerished conn.isAlive involves network requests, which can cause the p.idleMu.Lock() when obtaining conn from the pool to be blocked for too long.
1 parent 4bbb04f commit e8ce4ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x/mongo/driver/topology/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ type reason struct {
169169
// connectionPerished checks if a given connection is perished and should be removed from the pool.
170170
func connectionPerished(conn *connection) (reason, bool) {
171171
switch {
172-
case conn.closed() || !conn.isAlive():
172+
case conn.closed():
173173
// A connection would only be closed if it encountered a network error
174174
// during an operation and closed itself. If a connection is not alive
175175
// (e.g. the connection was closed by the server-side), it's also

0 commit comments

Comments
 (0)