Fix -f logs follow with stopped container#6559
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: QiWang19 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Does this fix journald logging as well, or just file logging? |
|
Does this work correct. In one window run In a separatee window When the first container ends, does the podman log command also end? |
|
This just unset the follow options for the file logging. |
|
Right but it has no effect on a running log. |
|
Looks not right, If run |
|
@QiWang19 When following logs on a running container, if the container is stopped, does the logging stop as well? I want to make sure this covers both use cases
|
Yes, the current upstream has both these issues that should be fixed and I am working on. |
|
@QiWang19 Could you rebase and repush. Tests do not seem to have run. Have you confirmed that this is running the way it should? |
|
This PR not fully fixed the issue. Still need more work on this. |
Fix -f logs follow with stopped container. Close containers#6531 Signed-off-by: Qi Wang <qiwan@redhat.com>
|
@QiWang19 I just tested this and following the logs hangs indefinitely if the container is running before running |
|
@QiWang19 I have traced the hang in the code to this line |
|
@QiWang19 I created a PR against your branch which handles multiple scenarios of following a log with stopped (or stopping) containers. What this does is create a subroutine which checks the state of the container every second. This is a similar approach taken when this bug was fixed 2 years ago. The difference with the new code from 2 years ago is libpod is using I tested the following conditions with this PR:
|
|
@jgallucci32 Could you open a PR for libpod with Yours and @QiWang19 Changes combined and here tests, Leave her signature and then we can merge the combination. |
Fix -f logs follow with stopped container. Close #6531
Signed-off-by: Qi Wang qiwan@redhat.com