Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

Vanient
Copy link

@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
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
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
Member

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

@codecov
Copy link

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