From c2271d59bbc4f26e534f5f0a31df54aadec8e3ff Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 10 Jun 2026 12:47:35 -0700 Subject: [PATCH] log_buffer: stop dumping the whole log entry on callback errors (#9919) The eachLogDataFn error path printed the full LogEntry proto. For an entry carrying a large chunk manifest that is hundreds of KB of escaped bytes in a single log line, burying the actual error -- often just a subscriber disconnect -- at the very end. Log the key, timestamp, offset and data size instead. --- weed/util/log_buffer/log_read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 364047f74..90134ff04 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -286,7 +286,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition lastReadPosition = NewMessagePosition(logEntry.TsNs, batchIndex) if isDone, err = eachLogDataFn(logEntry); err != nil { - glog.Errorf("LoopProcessLogData: %s process log entry %d %v: %v", readerName, batchSize+1, logEntry, err) + glog.Errorf("LoopProcessLogData: %s process log entry %d key:%q ts_ns:%d offset:%d size:%d: %v", readerName, batchSize+1, logEntry.Key, logEntry.TsNs, logEntry.Offset, len(logEntry.Data), err) return } if isDone { @@ -556,7 +556,7 @@ func (logBuffer *LogBuffer) LoopProcessLogDataWithOffset(readerName string, star glog.V(4).Infof("Calling eachLogDataFn for entry at offset %d, next position will be %d", logEntry.Offset, logEntry.Offset+1) if isDone, err = eachLogDataFn(logEntry, logEntry.Offset); err != nil { - glog.Errorf("LoopProcessLogDataWithOffset: %s process log entry %d %v: %v", readerName, batchSize+1, logEntry, err) + glog.Errorf("LoopProcessLogDataWithOffset: %s process log entry %d key:%q ts_ns:%d offset:%d size:%d: %v", readerName, batchSize+1, logEntry.Key, logEntry.TsNs, logEntry.Offset, len(logEntry.Data), err) return } if isDone {