Skip to content

Commit

Permalink
fix: sealsupra: Only schedule when needed (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k authored Oct 16, 2024
1 parent 959ada5 commit 583c9f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tasks/sealsupra/task_supraseal.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,15 @@ func (s *SupraSeal) Adder(taskFunc harmonytask.AddTaskFunc) {
}

func (s *SupraSeal) schedule(taskFunc harmonytask.AddTaskFunc) error {
if s.slots.Available() == 0 {
return nil
}

if err := hugepageutil.CheckHugePages(36); err != nil {
log.Warnw("huge pages check failed, try 'sudo sysctl -w vm.nr_hugepages=36' and make sure your system uses 1G huge pages", "err", err)
return nil
}

taskFunc(func(id harmonytask.TaskID, tx *harmonydb.Tx) (shouldCommit bool, seriousError error) {
// claim [sectors] pipeline entries
var sectors []struct {
Expand Down

0 comments on commit 583c9f7

Please sign in to comment.