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.

reset on getting the buffer

Chris Lu5a0986dca093
diff --git a/weed/util/log_buffer/log_buffer.go b/weed/util/log_buffer/log_buffer.go
index e447aacb76..69d663484a 100644
--- a/weed/util/log_buffer/log_buffer.go
+++ b/weed/util/log_buffer/log_buffer.go
@@ -226,7 +226,6 @@ func (m *LogBuffer) ReadFromBuffer(lastReadTime time.Time) (bufferCopy *bytes.Bu
}
func (m *LogBuffer) ReleaseMeory(b *bytes.Buffer) {
- b.Reset()
bufferPool.Put(b)
}
@@ -238,6 +237,7 @@ var bufferPool = sync.Pool{
func copiedBytes(buf []byte) (copied *bytes.Buffer) {
copied = bufferPool.Get().(*bytes.Buffer)
+ copied.Reset()
copied.Write(buf)
return
}