diff --git a/weed/util/log_buffer/log_buffer.go b/weed/util/log_buffer/log_buffer.go index aadc68a73..6c71a971e 100644 --- a/weed/util/log_buffer/log_buffer.go +++ b/weed/util/log_buffer/log_buffer.go @@ -278,7 +278,11 @@ func (logBuffer *LogBuffer) AddLogEntryToBuffer(logEntry *filer_pb.LogEntry) { logBuffer.LastTsNs.Store(processingTsNs) } - logEntryData, _ := proto.Marshal(logEntry) + logEntryData, marshalErr := proto.Marshal(logEntry) + if marshalErr != nil { + glog.Errorf("Failed to marshal LogEntry: %v", marshalErr) + return + } size := len(logEntryData) if logBuffer.pos == 0 { @@ -377,7 +381,11 @@ func (logBuffer *LogBuffer) AddDataToBuffer(partitionKey, data []byte, processin logEntry.Offset = logBuffer.offset // Marshal with correct timestamp and offset - logEntryData, _ := proto.Marshal(logEntry) + logEntryData, marshalErr := proto.Marshal(logEntry) + if marshalErr != nil { + glog.Errorf("Failed to marshal LogEntry: %v", marshalErr) + return + } size := len(logEntryData)