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

logread should not panic on an EOF, instead exiting gracefully #3937

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Jun 19, 2023

- What I did

logread (in pkg/memlogd) has an option to -f and follow. If not, then it reads until the end of the stream and exits.

Except it does not exit, it panic(), even if it is getting an EOF.

This changes it to exit sanely if it receives an EOF

- How I did it

Changed lines in pkg/memlogd/cmd/logread/main.go

- How to verify it

CI, and I did some manual testing. Beforehand, I got:

panic: EOF

goroutine 1 [running]:
main.main()
        /go/src/memlogd/cmd/logread/main.go:69 +0x426

After, it just exits cleanly

- Description for the changelog

Exit cleanly for logread when EOF

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch deitch merged commit 8e790a5 into linuxkit:master Jun 20, 2023
22 checks passed
@deitch deitch deleted the logread-exit-not-panic branch June 20, 2023 07:03
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

Successfully merging this pull request may close these issues.

None yet

1 participant