podman/libpod/events
Valentin Rothberg 408e764b94 events: no duplicates when streaming during a log rotation
When streaming events, prevent returning duplicates after a log rotation
by marking a beginning and an end for rotated events.  Before starting to
stream, get a timestamp while holding the event lock.  The timestamp
allows for detecting whether a rotation event happened while reading the
log file and to skip all events between the begin and end rotation
event.

In an ideal scenario, we could detect rotated events by enforcing a
chronological order when reading and skip those detected to not be more
recent than the last read event.  However, events are not always
_written_ in chronological order.  While this can be changed, existing
event files could not be read correctly anymore.

Fixes: #17665
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-15 10:28:16 +01:00
..
config.go container create: add inspect data to event 2022-11-29 10:40:24 +01:00
events.go Events for containers in pods now include the pod's ID 2022-09-22 14:18:56 -04:00
events_freebsd.go events: Fix spelling of newNullEventer 2022-09-13 08:38:13 +01:00
events_linux.go event backend none: return an error when reading events 2022-09-12 18:05:17 +02:00
events_unsupported.go events: Add freebsd support for libpod/event 2022-08-22 10:14:12 +01:00
filters.go events: support "die" filter 2022-12-22 10:59:40 +01:00
journal_linux.go journald: podman events only show events for current user 2023-01-27 16:20:32 +01:00
journal_unsupported.go go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
logfile.go events: no duplicates when streaming during a log rotation 2023-03-15 10:28:16 +01:00
logfile_test.go events: no duplicates when streaming during a log rotation 2023-03-15 10:28:16 +01:00
memory.go Add podman machine events 2022-05-03 13:49:01 -07:00
nullout.go Fix typos. Improve language. 2023-02-09 21:56:27 +01:00