[#674] object/put: Handle job submission errors
Close wait channel on shard pool error in order to prevent deadlock. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
40a4a7faa2
commit
3e4f0c1eb9
1 changed files with 5 additions and 2 deletions
|
@ -55,7 +55,7 @@ func (e *StorageEngine) Put(prm *PutPrm) (*PutRes, error) {
|
||||||
|
|
||||||
exitCh := make(chan struct{})
|
exitCh := make(chan struct{})
|
||||||
|
|
||||||
_ = pool.Submit(func() {
|
if err := pool.Submit(func() {
|
||||||
defer close(exitCh)
|
defer close(exitCh)
|
||||||
|
|
||||||
exists, err := s.Exists(existPrm)
|
exists, err := s.Exists(existPrm)
|
||||||
|
@ -96,7 +96,10 @@ func (e *StorageEngine) Put(prm *PutPrm) (*PutRes, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
finished = true
|
finished = true
|
||||||
})
|
}); err != nil {
|
||||||
|
// TODO: log errors except ErrOverload when errors of util.WorkerPool will be documented
|
||||||
|
close(exitCh)
|
||||||
|
}
|
||||||
|
|
||||||
<-exitCh
|
<-exitCh
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue