Skip to content

Commit 9de6669

Browse files
Avoiding race condition in batching
1 parent 646c67f commit 9de6669

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tasks/seal/poller_commit_msg.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ func (s *SealPoller) pollStartBatchCommitMsg(ctx context.Context, tasks []pollTa
111111
cutoff := abi.ChainEpoch(0)
112112
earliest := time.Now()
113113
for _, pt := range pts[i:end] {
114-
114+
if pt.SectorNumber == 0 { // Assuming SectorNumber is always set for valid pollTask
115+
log.Warnf("Skipping uninitialized pollTask in batch processing")
116+
continue
117+
}
115118
if cutoff == 0 || pt.StartEpoch < cutoff {
116119
cutoff = pt.StartEpoch
117120
}

0 commit comments

Comments
 (0)