File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ import (
1212
1313const (
1414 // eventsLostThreshold - only log when this many events are lost at once.
15+ // Small losses (1-10) are normal under high load and not worth logging.
1516 eventsLostThreshold = 50
17+
18+ // eventsLostMaxReasonable is the maximum "reasonable" number of lost events.
19+ eventsLostMaxReasonable = 1000000
1620)
1721
1822// eventStream implements libaudit.Stream interface for reassembled events
@@ -59,10 +63,12 @@ func (s *eventStream) ReassemblyComplete(msgs []*auparse.AuditMessage) {
5963 }
6064}
6165
62- // EventsLost is called when events were lost due to buffer overflow
66+ // EventsLost is called when events were lost due to buffer overflow or rate limiting.
67+ // We filter these out by checking against a reasonable maximum.
6368func (s * eventStream ) EventsLost (count int ) {
64- if count < eventsLostThreshold {
69+ // Filter out unreasonable values caused by sequence number rollover bug
70+ if count < eventsLostThreshold || count > eventsLostMaxReasonable {
6571 return
6672 }
67- utils .Logger .ErrorF ("auditd: %d events lost due to buffer overflow" , count )
73+ utils .Logger .ErrorF ("auditd: %d events lost due to buffer overflow or rate limiting " , count )
6874}
You can’t perform that action at this time.
0 commit comments