Skip to content

Log shim panic logs before shim cleanup#16

Merged
ambarve merged 1 commit intokevpar:fork/release/1.4from
ambarve:shim_panic_log
May 18, 2021
Merged

Log shim panic logs before shim cleanup#16
ambarve merged 1 commit intokevpar:fork/release/1.4from
ambarve:shim_panic_log

Conversation

@ambarve
Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread runtime/v2/bundle.go Outdated
Comment thread runtime/v2/bundle.go Outdated
Comment thread runtime/v2/bundle.go Outdated
@ambarve
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

dcantah commented May 5, 2021

@ambarve Cool thanks for clarification!

@ambarve
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread runtime/v2/bundle.go Outdated
Comment thread runtime/v2/bundle.go Outdated
Copy link
Copy Markdown
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
Copy Markdown
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