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

Log shim panic logs before shim cleanup #16

Merged
merged 1 commit into from
May 18, 2021

Conversation

ambarve
Copy link
Collaborator

@ambarve ambarve commented May 4, 2021

Changes the bundle cleanup function to look for a file named panic.log and log the contents of that file if it exists.

We already added a change to hcsshim to log the contents of panic.log file during shim delete command. However, that doesn't handle all of the cases. This change should fix that.

Signed-off-by: Amit Barve ambarve@microsoft.com

@ambarve ambarve marked this pull request as draft May 4, 2021 18:56
@ambarve ambarve marked this pull request as ready for review May 4, 2021 19:08
@dcantah
Copy link
Collaborator

dcantah commented May 4, 2021

@ambarve Bundle cleanup always gets called when cleaning up a container but shim delete doesn't, is that correct? So in most cases we'd get the shim panic logs logged twice? Once on shim delete and once on bundle cleanup when reading the file itself?

runtime/v2/bundle.go Outdated Show resolved Hide resolved
runtime/v2/bundle.go Outdated Show resolved Hide resolved
@ambarve
Copy link
Collaborator Author

ambarve commented May 5, 2021

@dcantah You are right, I was planning on removing that code from the shim delete command, I will push a PR for that.

@dcantah
Copy link
Collaborator

dcantah commented May 5, 2021

@ambarve Cool thanks for clarification!

@ambarve
Copy link
Collaborator Author

ambarve commented May 12, 2021

@dcantah Actually we shouldn't remove the logging changes added to hcsshim. This is because in some cases containerd calls shim delete first before calling delete on the bundle. In that case the shim delete command will remove the bundle directory and bundle cleanup will never find panic.log file.

@dcantah
Copy link
Collaborator

dcantah commented May 12, 2021

@ambarve Cool thanks for checking on this

@ambarve ambarve force-pushed the shim_panic_log branch 2 times, most recently from aec59f7 to 3b7de65 Compare May 14, 2021 18:56
runtime/v2/bundle.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

Small question and nit. Otherwise, LGTM.

Copy link
Collaborator

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

Same comment here about errors.Is but otherwise lgtm!

We already have code in hcsshim that logs the contents of the panic.log file during shim
delete command. However, that doesn't handle all of the cases. This change should fix
that.

Signed-off-by: Amit Barve <ambarve@microsoft.com>
@ambarve ambarve merged commit 1f460c3 into kevpar:fork/release/1.4 May 18, 2021
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.

4 participants