mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 06:09:17 +00:00
fix(logs): print logs with zero timestamps immediately to prevent indefinite stalling
This commit is contained in:
1 parent
c38d916dbb
commit
9ce624facd
2 files changed
+38
-10
No files matched your search
@@ -186,6 +186,13 @@ func (m *LogMerger) run() {
|
||||
e.stream.lastSeen = e.entry.Timestamp
|
||||
}
|
||||
if e.entry.Stream == api.LogStreamStdout || e.entry.Stream == api.LogStreamStderr {
|
||||
// Forward log entries with unparseable timestamps immediately. Without a timestamp we can't place
|
||||
// them on the merged timeline, and buffering them would stall the watermark.
|
||||
if e.entry.Timestamp.IsZero() {
|
||||
m.output <- e.entry
|
||||
<-e.stream.semaphore
|
||||
continue
|
||||
}
|
||||
heap.Push(&m.queue, queuedEntry{entry: e.entry, semaphore: e.stream.semaphore})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user