Repository navigation
Conversation
|
@ncdc It looks like it might be more readable if we would always try to get status before draining inside the loop. Atm there are 2 calls to wait and 2 calls to drain. |
|
@tonistiigi I think there always need to be 2 calls to drain: 1 inside the loop, and 1 outside after the loop exits. If |
|
@ncdc Yeah, I might be missing something. This is what I had in mind: |
|
That definitely looks nicer. @nalind wdyt? |
|
It's still a race, as you noted, but this can't hurt. |
In the journald log driver, attempt to drain the journal 1 more time after being told to stop following the log. Due to a possible race condition, sometimes data is written to the journal at almost the same time the log watch is closed, and depending on the order of operations, sometimes you miss the last journal entry. Signed-off-by: Andy Goldstein <[email protected]>
15d70bc to
76f58d7
Compare
|
@tonistiigi @nalind updated, ptal |
|
LGTM |
1 similar comment
|
LGTM |
- What I did
In the journald log driver, try to retrieve container log entries that appear immediately prior to the container exiting.
- How I did it
Attempt to drain the journal 1 more time after being told to stop following the log. Due to a possible race condition, sometimes data is written to the journal at almost the same time the log watch is closed, and depending on the order of operations, sometimes you miss the last journal entry.
- How to verify it
docker rm foodocker create --name foo centos:centos7 sh -c 'echo a; sleep 1; echo b; sleep 1; echo c' && docker start foo && docker logs -f fooc)- Description for the changelog
journald log driver: try to retrieve log entries emitted just prior to container termination when following a container's log
@runcom @nalind @jwhonce