summaryrefslogtreecommitdiff
path: root/test/system/130-kill.bats
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-05-20 11:07:28 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-05-26 14:51:58 +0200
commit10569c988f8ad3bfa796e52c61d7f4ef5266c193 (patch)
treee12de06edac87f07227587712f07e2014b49bfd6 /test/system/130-kill.bats
parente81457dc8e6632f4e9c7a4d240c9a73e8d509bb3 (diff)
downloadpodman-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/system/130-kill.bats')
-rw-r--r--test/system/130-kill.bats3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/system/130-kill.bats b/test/system/130-kill.bats
index 1b02b4976..3770eac27 100644
--- a/test/system/130-kill.bats
+++ b/test/system/130-kill.bats
@@ -8,8 +8,7 @@ load helpers
@test "podman kill - test signal handling in containers" {
# Start a container that will handle all signals by emitting 'got: N'
local -a signals=(1 2 3 4 5 6 8 10 12 13 14 15 16 20 21 22 23 24 25 26 64)
- # Force the k8s-file driver until #10323 is fixed.
- run_podman run --log-driver=k8s-file -d $IMAGE sh -c \
+ run_podman run -d $IMAGE sh -c \
"for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done;
echo READY;
while ! test -e /stop; do sleep 0.05; done;