[#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>
remotes/fyrchik/container-alias-fee
Leonard Lyubich 2021-10-08 17:33:51 +03:00 committed by Alex Vanin
parent 40a4a7faa2
commit 3e4f0c1eb9
1 changed files with 5 additions and 2 deletions

View File

@ -55,7 +55,7 @@ func (e *StorageEngine) Put(prm *PutPrm) (*PutRes, error) {
exitCh := make(chan struct{})
_ = pool.Submit(func() {
if err := pool.Submit(func() {
defer close(exitCh)
exists, err := s.Exists(existPrm)
@ -96,7 +96,10 @@ func (e *StorageEngine) Put(prm *PutPrm) (*PutRes, error) {
}
finished = true
})
}); err != nil {
// TODO: log errors except ErrOverload when errors of util.WorkerPool will be documented
close(exitCh)
}
<-exitCh