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

Fix: gettyRPCClientPool.remove deadlock #183

Merged
merged 2 commits into from
Aug 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions protocol/dubbo/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ func (p *gettyRPCClientPool) close() {
func (p *gettyRPCClientPool) getGettyRpcClient(protocol, addr string) (*gettyRPCClient, error) {

p.Lock()
defer p.Unlock()
if p.conns == nil {
return nil, errClientPoolClosed
}
Expand All @@ -290,12 +291,9 @@ func (p *gettyRPCClientPool) getGettyRpcClient(protocol, addr string) (*gettyRPC
continue
}
conn.created = now //update created time

p.Unlock()
return conn, nil
}
// create new conn
p.Unlock()
return newGettyRPCClientConn(p, protocol, addr)
}

Expand Down