v1.27.0-a #10

Closed
jonathanface wants to merge 473 commits from v1.27.0-a into master
3 changed files with 15 additions and 6 deletions
Showing only changes of commit af79813af8 - Show all commits

View File

@ -4,7 +4,6 @@ import (
"bytes" "bytes"
"crypto/rand" "crypto/rand"
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
@ -293,20 +292,23 @@ func BenchmarkBuildTreeD512M(b *testing.B) {
} }
} }
if b.N == 1 { /*if b.N == 1 {
b.N = 10 b.N = 10
} }*/
b.SetBytes(int64(dataSize)) // Set the number of bytes for the benchmark b.SetBytes(int64(dataSize)) // Set the number of bytes for the benchmark
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
// Create a temporary file for each iteration // Create a temporary file for each iteration
tempFile, err := ioutil.TempFile("", "tree.dat") tempFile, err := os.CreateTemp("", "tree.dat")
if err != nil { if err != nil {
b.Fatalf("Failed to create temporary file: %v", err) b.Fatalf("Failed to create temporary file: %v", err)
} }
tempFilePath := tempFile.Name() tempFilePath := tempFile.Name()
tempFile.Close() err = tempFile.Close()
if err != nil {
b.Fatalf("Failed to close temporary file: %v", err)
}
b.StartTimer() // Start the timer for the BuildTreeD operation b.StartTimer() // Start the timer for the BuildTreeD operation
@ -318,6 +320,9 @@ func BenchmarkBuildTreeD512M(b *testing.B) {
b.StopTimer() // Stop the timer after BuildTreeD completes b.StopTimer() // Stop the timer after BuildTreeD completes
// Clean up the temporary file // Clean up the temporary file
os.Remove(tempFilePath) err = os.Remove(tempFilePath)
if err != nil {
b.Fatalf("Failed to remove temporary file: %v", err)
}
} }
} }

View File

@ -123,6 +123,7 @@ func (s *SealPoller) poll(ctx context.Context) error {
} }
for _, task := range tasks { for _, task := range tasks {
task := task
if task.Failed { if task.Failed {
continue continue
} }

View File

@ -63,6 +63,9 @@ func AllocateSectorNumbers(ctx context.Context, a AllocAPI, db *harmonydb.DB, ma
Len: abi.MaxSectorNumber, Len: abi.MaxSectorNumber,
}, },
}}) }})
if err != nil {
return false, xerrors.Errorf("creating assignable sector numbers: %w", err)
}
inverted, err := bitfield.SubtractBitField(allAssignable, merged) inverted, err := bitfield.SubtractBitField(allAssignable, merged)
if err != nil { if err != nil {