Merge pull request #9495 from filecoin-project/fix/postsched-ping-flood
fix: post worker sched: Don't check worker session in a busy loop
This commit is contained in:
commit
8a2f8c34cc
@ -169,6 +169,12 @@ func (ps *poStScheduler) watch(wid storiface.WorkerID, worker *WorkerHandle) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
select {
|
||||||
|
case <-heartbeatTimer.C:
|
||||||
|
case <-worker.closingMgr:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sctx, scancel := context.WithTimeout(ctx, paths.HeartbeatInterval/2)
|
sctx, scancel := context.WithTimeout(ctx, paths.HeartbeatInterval/2)
|
||||||
curSes, err := worker.workerRpc.Session(sctx)
|
curSes, err := worker.workerRpc.Session(sctx)
|
||||||
scancel()
|
scancel()
|
||||||
@ -177,12 +183,7 @@ func (ps *poStScheduler) watch(wid storiface.WorkerID, worker *WorkerHandle) {
|
|||||||
log.Warnw("failed to check worker session", "error", err)
|
log.Warnw("failed to check worker session", "error", err)
|
||||||
ps.disable(wid)
|
ps.disable(wid)
|
||||||
|
|
||||||
select {
|
|
||||||
case <-heartbeatTimer.C:
|
|
||||||
continue
|
continue
|
||||||
case <-worker.closingMgr:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if storiface.WorkerID(curSes) != wid {
|
if storiface.WorkerID(curSes) != wid {
|
||||||
|
Loading…
Reference in New Issue
Block a user