2
0

Fix deadlock in Pool.CreateResource

This commit is contained in:
Dmitriy Matrenichev
2021-09-11 02:15:45 +03:00
committed by GitHub
parent f196d0d9f9
commit aa0e8cd5bc
+1
View File
@@ -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)