We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eab45e1 + ef0fc3e commit c3fb0c6Copy full SHA for c3fb0c6
logs/journald_reader.go
@@ -11,6 +11,10 @@ import (
11
"k8s.io/klog/v2"
12
)
13
14
+const (
15
+ journaldPollTimeout = 100 * time.Millisecond
16
+)
17
+
18
type JournaldReader struct {
19
journal *sdjournal.Journal
20
subscribers map[string]chan<- logparser.LogEntry
@@ -60,7 +64,11 @@ func (r *JournaldReader) follow() {
60
64
return
61
65
}
62
66
if c <= 0 {
63
- r.journal.Wait(time.Millisecond * 100)
67
+ t := time.Now()
68
+ ret := r.journal.Wait(journaldPollTimeout)
69
+ if ret <= 0 && time.Since(t) < journaldPollTimeout { // inotify can't work due to system limits
70
+ time.Sleep(journaldPollTimeout)
71
+ }
72
continue
73
74
e, err := r.journal.GetEntry()
0 commit comments