Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transport: pool, closeAll should wait until all connection loops are stopped #290

Open
Kulezi opened this issue Sep 16, 2022 · 0 comments
Open
Labels
bug Something isn't working transport

Comments

@Kulezi
Copy link
Contributor

Kulezi commented Sep 16, 2022

Right now pool.CloseAll() calls Close() on all connections it has, but doesn't wait until their loops are actually stopped before exiting itself.

Goroutines running the connection loops stop fast, but after session.Close() returns they should be already stopped, otherwise goleak will complain about leaked goroutines in tests.

// closeAll is called by PoolRefiller.
func (p *ConnPool) closeAll() {
for i := range p.conns {
if conn, ok := p.conns[i].Swap((*Conn)(nil)).(*Conn); ok {
conn.Close()
}
}
}

@Kulezi Kulezi added bug Something isn't working transport labels Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working transport
Projects
None yet
Development

No branches or pull requests

1 participant