workers: Mark on-restart-failed returned tasks as returned
This commit is contained in:
parent
03c3d8bdb3
commit
b8865fb182
5
extern/sector-storage/manager_test.go
vendored
5
extern/sector-storage/manager_test.go
vendored
@ -338,4 +338,9 @@ func TestRestartWorker(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
<-apDone
|
||||
|
||||
time.Sleep(12 * time.Millisecond)
|
||||
uf, err := w.ct.unfinished()
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, uf)
|
||||
}
|
||||
|
2
extern/sector-storage/teststorage_test.go
vendored
2
extern/sector-storage/teststorage_test.go
vendored
@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
type apres struct {
|
||||
pi abi.PieceInfo
|
||||
pi abi.PieceInfo
|
||||
err error
|
||||
}
|
||||
|
||||
|
6
extern/sector-storage/worker_calltracker.go
vendored
6
extern/sector-storage/worker_calltracker.go
vendored
@ -29,9 +29,9 @@ type Call struct {
|
||||
|
||||
func (wt *workerCallTracker) onStart(ci storiface.CallID, rt ReturnType) error {
|
||||
return wt.st.Begin(ci, &Call{
|
||||
ID: ci,
|
||||
RetType:rt,
|
||||
State: CallStarted,
|
||||
ID: ci,
|
||||
RetType: rt,
|
||||
State: CallStarted,
|
||||
})
|
||||
}
|
||||
|
||||
|
8
extern/sector-storage/worker_local.go
vendored
8
extern/sector-storage/worker_local.go
vendored
@ -65,7 +65,7 @@ func newLocalWorker(executor func() (ffiwrapper.Storage, error), wcfg WorkerConf
|
||||
st: cst,
|
||||
},
|
||||
acceptTasks: acceptTasks,
|
||||
executor: executor,
|
||||
executor: executor,
|
||||
|
||||
closing: make(chan struct{}),
|
||||
}
|
||||
@ -86,11 +86,15 @@ func newLocalWorker(executor func() (ffiwrapper.Storage, error), wcfg WorkerConf
|
||||
|
||||
if err := returnFunc[call.RetType](context.TODO(), call.ID, ret, nil, err); err != nil {
|
||||
log.Errorf("return error: %s: %+v", call.RetType, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if err := w.ct.onReturned(call.ID); err != nil {
|
||||
log.Errorf("marking call as returned failed: %s: %+v", call.RetType, err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
return w
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user