Fix deadlock in Pool.CreateResource
This commit is contained in:
committed by
GitHub
parent
f196d0d9f9
commit
aa0e8cd5bc
@@ -409,6 +409,7 @@ func (p *Pool) CreateResource(ctx context.Context) error {
|
|||||||
// If closed while constructing resource then destroy it and return an error
|
// If closed while constructing resource then destroy it and return an error
|
||||||
if p.closed {
|
if p.closed {
|
||||||
go p.destructResourceValue(res.value)
|
go p.destructResourceValue(res.value)
|
||||||
|
p.cond.L.Unlock()
|
||||||
return ErrClosedPool
|
return ErrClosedPool
|
||||||
}
|
}
|
||||||
p.allResources = append(p.allResources, res)
|
p.allResources = append(p.allResources, res)
|
||||||
|
|||||||
Reference in New Issue
Block a user