sectorstorage: Missing unlock in waitWork

This commit is contained in:
Łukasz Magiera 2020-10-29 15:18:30 +01:00
parent ea5bb5cdab
commit c6b03ce62b
2 changed files with 4 additions and 0 deletions

View File

@ -271,6 +271,7 @@ func (m *Manager) waitWork(ctx context.Context, wid WorkID) (interface{}, error)
res, ok := m.results[wid] res, ok := m.results[wid]
if ok { if ok {
done() done()
m.workLk.Unlock()
return res.r, res.err return res.r, res.err
} }

View File

@ -296,6 +296,9 @@ func TestRestartManager(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 1, tw.pc1s) require.Equal(t, 1, tw.pc1s)
ws := m.WorkerJobs()
require.Empty(t, ws)
} }
} }