Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: f3: Keep retrying the task forever #337

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tasks/f3/f3_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

logging "github.com/ipfs/go-log/v2"
magik6k marked this conversation as resolved.
Show resolved Hide resolved
"github.com/yugabyte/pgx/v5"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down Expand Up @@ -71,6 +72,12 @@ func (f *F3Task) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done boo
var spID int64
err = f.db.QueryRow(ctx, "SELECT sp_id FROM f3_tasks WHERE task_id = $1", taskID).Scan(&spID)
if err != nil {
if err == pgx.ErrNoRows {
// can only happen when the SP ID was removed from the cluster configuration
log.Warnw("marking f3 task with no corresponding spid as done", "task", taskID)
return true, nil
}

return false, xerrors.Errorf("failed to get sp_id: %w", err)
}

Expand Down Expand Up @@ -195,7 +202,10 @@ func (f *F3Task) TypeDetails() harmonytask.TaskTypeDetails {
Gpu: 0,
Ram: 10 << 20,
},
MaxFailures: 1,
// No MaxRetries, never kill this task
RetryWait: func(retries int) time.Duration {
return time.Minute
},
}
}

Expand Down
Loading