From 580a7fa685da41c9968c38351340e34d24683bdf Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 27 Aug 2022 00:19:13 -0700 Subject: [PATCH] adjust for data race fix https://github.com/seaweedfs/seaweedfs/issues/3512 --- weed/server/filer_server_handlers_write_upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/server/filer_server_handlers_write_upload.go b/weed/server/filer_server_handlers_write_upload.go index c4565b08b..519f989c0 100644 --- a/weed/server/filer_server_handlers_write_upload.go +++ b/weed/server/filer_server_handlers_write_upload.go @@ -57,14 +57,14 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque // need to throttle used byte buffer bytesBufferLimitCond.L.Lock() for atomic.LoadInt64(&bytesBufferCounter) >= 4 { - glog.V(4).Infof("waiting for byte buffer %d", bytesBufferCounter) + glog.V(4).Infof("waiting for byte buffer %d", atomic.LoadInt64(&bytesBufferCounter)) bytesBufferLimitCond.Wait() } atomic.AddInt64(&bytesBufferCounter, 1) bytesBufferLimitCond.L.Unlock() bytesBuffer := bufPool.Get().(*bytes.Buffer) - glog.V(4).Infof("received byte buffer %d", bytesBufferCounter) + glog.V(4).Infof("received byte buffer %d", atomic.LoadInt64(&bytesBufferCounter)) limitedReader := io.LimitReader(partReader, int64(chunkSize))