Skip to content

Fix docker logs hangs after stop container when using journald#39305

Closed
Vanient wants to merge 1 commit intomoby:masterfrom
Vanient:master
Closed

Fix docker logs hangs after stop container when using journald#39305
Vanient wants to merge 1 commit intomoby:masterfrom
Vanient:master

Conversation

@Vanient
Copy link
Copy Markdown

@Vanient Vanient commented Jun 3, 2019

Fix when using journald as log-driver, docker logs -f hangs
after the container is exited. LogWatcher.WatchProducerGone() returns a
channel receiver to receive notification once container is gone.

fixes docker/for-linux#575

Signed-off-by: Danni Xia xiadanni1@huawei.com

- What I did
fix docker/for-linux#575

- How I did it
Add logWatcher.WatchProducerGone() to receive notification when container is gone.

- How to verify it
docker logs -f $(docker run -d --rm --log-driver journald busybox sh -c "for i in \$(seq 1 10); do echo logline \$i; sleep 1; done")
Verify that docker logs process can exit.

@kolyshkin
Copy link
Copy Markdown
Contributor

@Vanient journald log driver has lots of issues, some (including docker/for-linux#575) are addressed in #38859, you are more than welcome to give it a review and test.

@kolyshkin
Copy link
Copy Markdown
Contributor

In particular, the fix for docker/for-linux#575 is here: cd13be8

Fix when using journald as log-driver, docker logs -f <containerID> hangs
after the container is exited. LogWatcher.WatchProducerGone() returns a
channel receiver to receive notification once container is gone.

fixes docker/for-linux#575

Signed-off-by: Danni Xia <xiadanni1@huawei.com>
@thaJeztah
Copy link
Copy Markdown
Member

@kolyshkin I see this was updated after your last comment; PTAL

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@0105613). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #39305   +/-   ##
=========================================
  Coverage          ?   37.05%           
=========================================
  Files             ?      612           
  Lines             ?    45486           
  Branches          ?        0           
=========================================
  Hits              ?    16854           
  Misses            ?    26347           
  Partials          ?     2285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

when using journald log-driver, follow logs hangs after container is exited

5 participants