removeConnWithLock removes a connection from the pool under the connsMu lock. Returns true if the connection was actually present in p.conns and was removed, false if it was already gone (e.g., removed by Close()). Callers must use the return value to decide whether to emit metric decrements — this
(cn *Conn)
| 1498 | // return value to decide whether to emit metric decrements — this eliminates the |
| 1499 | // shutdown race between Close() and concurrent removal paths. |
| 1500 | func (p *ConnPool) removeConnWithLock(cn *Conn) bool { |
| 1501 | p.connsMu.Lock() |
| 1502 | defer p.connsMu.Unlock() |
| 1503 | return p.removeConn(cn) |
| 1504 | } |
| 1505 | |
| 1506 | // removeConn removes a connection from the pool's internal data structures. |
| 1507 | // Returns true if the connection was present and removed, false otherwise. |
no test coverage detected