Skip to content

fix: free turn of connection pool when leave with error#2658

Merged
ofekshenawa merged 6 commits intoredis:masterfrom
cyningsun:bugfix_conn_pool_turnleak
Oct 30, 2023
Merged

fix: free turn of connection pool when leave with error#2658
ofekshenawa merged 6 commits intoredis:masterfrom
cyningsun:bugfix_conn_pool_turnleak

Conversation

@cyningsun
Copy link
Contributor

pool turn is taken but without free after calling popIdle() and leave with error.

There are two if conditions may return error inside popIdle()

func (p *ConnPool) popIdle() (*Conn, error) {
	if p.closed() {
		return nil, ErrClosed
	}
	n := len(p.idleConns)
	if n == 0 {
		return nil, nil
	}

@chayim chayim added the bug label Jul 23, 2023
@ofekshenawa ofekshenawa merged commit 4408f8c into redis:master Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants