diff options
| author | chrislu <chris.lu@gmail.com> | 2024-03-10 14:34:28 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-03-10 14:34:28 -0700 |
| commit | 6f75a0af55811fcfd584f4bf136cdc42db9cff5a (patch) | |
| tree | eff13da0237d6acf8a669a0262875ec2fc1d869f /weed/util/log_buffer/log_read.go | |
| parent | c1a5952009e58fb6524fa18b33ad1ab9e8794fd5 (diff) | |
| download | seaweedfs-6f75a0af55811fcfd584f4bf136cdc42db9cff5a.tar.xz seaweedfs-6f75a0af55811fcfd584f4bf136cdc42db9cff5a.zip | |
ask follower to follow
Diffstat (limited to 'weed/util/log_buffer/log_read.go')
| -rw-r--r-- | weed/util/log_buffer/log_read.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 5529a6691..d7ca47155 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -57,7 +57,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition if bytesBuf != nil { readSize = bytesBuf.Len() } - glog.V(0).Infof("%s ReadFromBuffer at %v batch:%d, read bytes:%v batch:%d", readerName, lastReadPosition, lastReadPosition.BatchIndex, readSize, batchIndex) + glog.V(0).Infof("%s ReadFromBuffer at %v batch %d. Read bytes %v batch %d", readerName, lastReadPosition, lastReadPosition.BatchIndex, readSize, batchIndex) if bytesBuf == nil { if batchIndex >= 0 { lastReadPosition = NewMessagePosition(lastReadPosition.UnixNano(), batchIndex) @@ -72,6 +72,10 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition isDone = true return } + if logBuffer.IsStopping() { + isDone = true + return + } } buf := bytesBuf.Bytes() @@ -107,6 +111,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition return } if isDone { + glog.V(0).Infof("LoopProcessLogData2: %s process log entry %d", readerName, batchSize+1) return } |
