projectatomic / docker

Docker - the open-source application container engine
http://www.docker.com
Apache License 2.0
81 stars 58 forks source link

journald logs: drain 1 more time at container exit #291

Closed tnozicka closed 6 years ago

tnozicka commented 6 years ago

resurrected https://github.com/projectatomic/docker/pull/218 (for master) after @ncdc

I hope it fixes https://github.com/openshift/origin/issues/17747

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.

I'm opening this here for starters so we can discuss. If we decide to proceed with this or something like it, I'll open a pull against docker/docker.

Fixes issues seen in OpenShift e2e tests such as this: openshift/origin#9839 (comment)

/cc @nalind @runcom @rhatdan @smarterclayton @mrunalp @jwhonce @soltysh @mfojtik @deads2k

runcom commented 6 years ago

@nalind PTAL

runcom commented 6 years ago

@tnozicka branch is wrong, you need to open this PR against docker-1.12.6 branch

tnozicka commented 6 years ago

oh, that already has it, I guess it just lacked a link in the old PR https://github.com/projectatomic/docker/blob/docker-1.12.6/daemon/logger/journald/read.go#L262-L269

apologies for the noise