diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-05-20 11:07:28 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-05-26 14:51:58 +0200 |
commit | 10569c988f8ad3bfa796e52c61d7f4ef5266c193 (patch) | |
tree | e12de06edac87f07227587712f07e2014b49bfd6 /test/e2e/attach_test.go | |
parent | e81457dc8e6632f4e9c7a4d240c9a73e8d509bb3 (diff) | |
download | podman-10569c988f8ad3bfa796e52c61d7f4ef5266c193.tar.gz podman-10569c988f8ad3bfa796e52c61d7f4ef5266c193.tar.bz2 podman-10569c988f8ad3bfa796e52c61d7f4ef5266c193.zip |
journald logger: fix race condition
Fix a race in journald driver. Following the logs implies streaming
until the container is dead. Streaming happened in one goroutine,
waiting for the container to exit/die and signaling that event happened
in another goroutine.
The nature of having two goroutines running simultaneously is pretty
much the core of the race condition. When the streaming goroutines
received the signal that the container has exitted, the routine may not
have read and written all of the container's logs.
Fix this race by reading both, the logs and the events, of the container
and stop streaming when the died/exited event has been read. The died
event is guaranteed to be after all logs in the journal which guarantees
not only consistencty but also a deterministic behavior.
Note that the journald log driver now requires the journald event
backend to be set.
Fixes: #10323
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/e2e/attach_test.go')
0 files changed, 0 insertions, 0 deletions