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

Docker logs --follow doesn't exit when container is removed #7577

Closed
tnachen opened this issue Aug 14, 2014 · 7 comments
Closed

Docker logs --follow doesn't exit when container is removed #7577

tnachen opened this issue Aug 14, 2014 · 7 comments

Comments

@tnachen
Copy link

tnachen commented Aug 14, 2014

Currently Docker logs --follow supposedly should exit when the docker container is removed, but occasionally we're seeing Docker logs --follow still running while the docker container is no longer there.

@tnachen
Copy link
Author

tnachen commented Aug 14, 2014

Looking at the strace:

epoll_wait(4,

/proc/9798/fd# ls -la
total 0
dr-x------ 2 root root 0 Aug 14 07:05 .
dr-xr-xr-x 9 root root 0 Aug 14 07:05 ..
lr-x------ 1 root root 64 Aug 14 07:11 0 -> /dev/null
l-wx------ 1 root root 64 Aug 14 07:11 1 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_5C1mOM/slaves/20140814-070521-3823062160-59417-9652-0/frameworks/20140814-070521-3823062160-59417-9652-0000/executors/1/runs/7c7ba4ca-0e04-4cd4-a782-4923e2c5a469/stdout (deleted)
lrwx------ 1 root root 64 Aug 14 07:11 10 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_rD4ajQ/master/replicated_log/000004.log (deleted)
l-wx------ 1 root root 64 Aug 14 07:11 2 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_5C1mOM/slaves/20140814-070521-3823062160-59417-9652-0/frameworks/20140814-070521-3823062160-59417-9652-0000/executors/1/runs/7c7ba4ca-0e04-4cd4-a782-4923e2c5a469/stderr (deleted)
lrwx------ 1 root root 64 Aug 14 07:11 3 -> socket:[232447442]
lrwx------ 1 root root 64 Aug 14 07:11 4 -> anon_inode:[eventpoll]
lrwx------ 1 root root 64 Aug 14 07:11 5 -> socket:[232447443]
l-wx------ 1 root root 64 Aug 14 07:11 6 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_rD4ajQ/master/replicated_log/LOG (deleted)
lrwx------ 1 root root 64 Aug 14 07:11 7 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_rD4ajQ/master/replicated_log/LOCK (deleted)
lrwx------ 1 root root 64 Aug 14 07:11 9 -> /tmp/DockerContainerizerTest_ROOT_DOCKER_Logs_rD4ajQ/master/replicated_log/MANIFEST-000002 (deleted)

Looking at 4 is already a broken symlink.

@cpuguy83
Copy link
Member

Closing. dup of #7020

@tnachen
Copy link
Author

tnachen commented Aug 14, 2014

@cpuguy83 I'm not sure it's a dup as the container isn't just stopped but completely removed, but docker logs --follow somehow still running.

@cpuguy83
Copy link
Member

@tnachen Hmm I didn't realize your container was removed... but it's probably due to the same issue.

@tnachen tnachen changed the title Docker logs --follow doesn't exit when container stops Docker logs --follow doesn't exit when container is removed Aug 14, 2014
@tnachen
Copy link
Author

tnachen commented Aug 14, 2014

@cpuguy83 so I am able to reproduce this 100% now:

in bash #1
docker run -d busybox echo hi
be83cba526dd07e4af70eadc668c06bf486a68e016acbdf55fb70ad207c0191a
docker logs --follow
hi

after in bash #2
docker rm -f be83cba526dd07e4af70eadc668c06bf486a68e016acbdf55fb70ad207c0191a

looking back at the docker logs --follow process it's still hanging there forever.

This should be a bug right?

@cpuguy83
Copy link
Member

I consider it a bug, but also should be in the other issue, I think.
Can you post in there?

@tnachen
Copy link
Author

tnachen commented Aug 14, 2014

Sounds good, I'll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants