Skip to content

Commit 84f9f4e

Browse files
magik6krvagg
authored andcommitted
fix proofshare log spam (#608)
* fix proofshare log spam * proofshare: Mark tasks done when pipeline is not found
1 parent 35c14eb commit 84f9f4e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/proofsvc/clientctl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ func GetProofStatus(ctx context.Context, requestCid cid.Cid) (common.ProofRespon
277277
return common.ProofResponse{}, xerrors.Errorf("failed to unmarshal response body: %w", err)
278278
}
279279

280-
// If the proof is not ready yet, return an error to trigger retry
280+
// not ready yet, return empty response to the poller above
281281
if proofResp.Proof == nil && proofResp.Error == "" {
282-
return common.ProofResponse{}, xerrors.Errorf("proof not ready yet")
282+
return common.ProofResponse{}, nil
283283
}
284284

285285
// If there's an error in the proof generation, return it

tasks/proofshare/task_client_poll.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (t *TaskClientPoll) Do(taskID harmonytask.TaskID, stillOwned func() bool) (
146146
}
147147
if err != nil && errors.Is(err, pgx.ErrNoRows) {
148148
log.Infow("client request not found", "taskID", taskID)
149-
return false, nil
149+
return true, nil
150150
}
151151

152152
pollCtx, ownedCancel := context.WithCancel(ctx)
@@ -185,7 +185,7 @@ func (t *TaskClientPoll) Do(taskID harmonytask.TaskID, stillOwned func() bool) (
185185

186186
// check if the task is still owned
187187
if !stillOwned() {
188-
return false, nil
188+
return false, xerrors.Errorf("yield")
189189
}
190190
}
191191

@@ -235,7 +235,6 @@ func NewTaskClientPoll(db *harmonydb.DB, api ClientServiceAPI) *TaskClientPoll {
235235

236236
// pollForProof polls for the proof status
237237
func pollForProof(ctx context.Context, db *harmonydb.DB, taskID harmonytask.TaskID, clientRequest *ClientRequest) (bool, []byte, error) {
238-
log.Infow("pollForProof", "taskID", taskID, "requestCID", clientRequest.RequestCID)
239238
// Parse the request CID
240239
requestCid, err := cid.Parse(*clientRequest.RequestCID)
241240
if err != nil {
@@ -245,7 +244,6 @@ func pollForProof(ctx context.Context, db *harmonydb.DB, taskID harmonytask.Task
245244
// Get proof status by CID
246245
proofResp, err := proofsvc.GetProofStatus(ctx, requestCid)
247246
if err != nil || proofResp.Proof == nil {
248-
log.Infow("proof not ready", "taskID", taskID, "spID", clientRequest.SpID, "sectorNumber", clientRequest.SectorNumber)
249247
// Not ready yet, continue polling
250248
return false, nil, nil
251249
}

tasks/proofshare/task_client_upload.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func (t *TaskClientUpload) Do(taskID harmonytask.TaskID, stillOwned func() bool)
6363
if err != nil && !errors.Is(err, pgx.ErrNoRows) {
6464
return false, xerrors.Errorf("failed to get client request: %w", err)
6565
}
66+
if err != nil && errors.Is(err, pgx.ErrNoRows) {
67+
log.Infow("client upload not found", "taskID", taskID)
68+
return true, nil
69+
}
6670

6771
if clientRequest.RequestSent && len(clientRequest.ResponseData) > 0 {
6872
// special case: pipeline was done but re-entered due to the retry button on the PrRep page being clicked

0 commit comments

Comments
 (0)