Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix(benchmark): close CPU profile file handle after profiling (#10048)

AlexALei091d953c3411
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index de631585c1..86d9b358da 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -131,7 +131,10 @@ func runBenchmark(cmd *Command, args []string) bool {
glog.Fatal(err)
}
pprof.StartCPUProfile(f)
- defer pprof.StopCPUProfile()
+ defer func() {
+ pprof.StopCPUProfile()
+ f.Close()
+ }()
}
// Determine what operations to perform