Merge pull request #7844 from llifezou/add_workerName_in_sealing_err
feat: #6147: Include worker name in sealing errors
This commit is contained in:
commit
a6892f956e
17
extern/sector-storage/worker_local.go
vendored
17
extern/sector-storage/worker_local.go
vendored
@ -102,7 +102,13 @@ func newLocalWorker(executor ExecutorFunc, wcfg WorkerConfig, envLookup EnvFunc,
|
||||
|
||||
go func() {
|
||||
for _, call := range unfinished {
|
||||
err := storiface.Err(storiface.ErrTempWorkerRestart, xerrors.New("worker restarted"))
|
||||
hostname, osErr := os.Hostname()
|
||||
if osErr != nil {
|
||||
log.Errorf("get hostname err: %+v", err)
|
||||
hostname = ""
|
||||
}
|
||||
|
||||
err := storiface.Err(storiface.ErrTempWorkerRestart, xerrors.Errorf("worker [Hostname: %s] restarted", hostname))
|
||||
|
||||
// TODO: Handle restarting PC1 once support is merged
|
||||
|
||||
@ -263,6 +269,15 @@ func (l *LocalWorker) asyncCall(ctx context.Context, sector storage.SectorRef, r
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
hostname, osErr := os.Hostname()
|
||||
if osErr != nil {
|
||||
log.Errorf("get hostname err: %+v", err)
|
||||
}
|
||||
|
||||
err = xerrors.Errorf("%w [Hostname: %s]", err.Error(), hostname)
|
||||
}
|
||||
|
||||
if doReturn(ctx, rt, ci, l.ret, res, toCallError(err)) {
|
||||
if err := l.ct.onReturned(ci); err != nil {
|
||||
log.Errorf("tracking call (done): %+v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user