Merge pull request #712 from filecoin-project/fix/clean-fpost-exit
storageminer: exit fpostScheduler loop cleanly
This commit is contained in:
commit
90dfb18ab8
@ -49,10 +49,17 @@ func (s *fpostScheduler) run(ctx context.Context) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
defer s.abortActivePoSt()
|
||||
|
||||
// not fine to panic after this point
|
||||
for {
|
||||
select {
|
||||
case changes := <-notifs:
|
||||
case changes, ok := <-notifs:
|
||||
if !ok {
|
||||
log.Warn("fpostScheduler notifs channel closed")
|
||||
return
|
||||
}
|
||||
|
||||
ctx, span := trace.StartSpan(ctx, "fpostScheduler.headChange")
|
||||
|
||||
var lowest, highest *types.TipSet = s.cur, nil
|
||||
@ -74,6 +81,8 @@ func (s *fpostScheduler) run(ctx context.Context) {
|
||||
}
|
||||
|
||||
span.End()
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user