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 podman logs --tail when log is bigger than pagesize #7232

Merged
merged 1 commit into from
Aug 7, 2020

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Aug 5, 2020

Fixes #7230

@@ -61,6 +61,6 @@ func (r *ReverseReader) Read() (string, error) {
b = b[0:n]
}
// Set to the next page boundary
r.offset = -r.readSize
r.offset -= r.readSize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's adjust the comment to reflect what is done now

@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2020

LGTM with @giuseppe comment.

@mheon
Copy link
Member

mheon commented Aug 5, 2020

New test also seems to be failing

@TomSweeneyRedHat
Copy link
Member

LGTM
assuming happy tests and the code comment is tweaked.

@Luap99 Luap99 force-pushed the podman-logs-tail branch from bf13242 to 2c79f99 Compare August 6, 2020 18:56
@Luap99
Copy link
Member Author

Luap99 commented Aug 6, 2020

OK, I updated the code. Tests were failing due an race condition were the file was closed to early. Should be fixed now.

@@ -101,11 +101,14 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
if err != nil {
if errors.Cause(err) == io.EOF {
inputs <- []string{leftover}
close(inputs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this close done somewhere else? Is it not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is closed below

@rhatdan
Copy link
Member

rhatdan commented Aug 7, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2020
@rhatdan
Copy link
Member

rhatdan commented Aug 7, 2020

/approve
Thanks @Luap99

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2020
@openshift-merge-robot openshift-merge-robot merged commit 51159e7 into containers:master Aug 7, 2020
@Luap99 Luap99 deleted the podman-logs-tail branch January 2, 2021 20:18
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman logs often cannot use --tail due to some parsing issue
7 participants