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

downgrade log messages for killing containers #80

Closed
wants to merge 1 commit into from

Conversation

dustinblack
Copy link
Member

Changes introduced with this PR

Downgrade the log messages regarding killing containers from warning to info to reduce noise.


By contributing to this repository, I agree to the contribution guidelines.

} else {
p.logger.Warningf("successfully killed container %s", containerName)
p.logger.Infof("successfully killed container %s", containerName)

Choose a reason for hiding this comment

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

Is this even worth logging? Should it be a debug severity instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm. It could go either way. If it gets here, it means it was still running. I think it's better for it to finish on its own. But debug instead of no logging for sure.

@@ -86,9 +86,9 @@ func (p *cliWrapper) KillAndClean(containerName string) error {
cmdKill := p.getPodmanCmd("kill", containerName)
p.logger.Debugf("Killing with command %v", cmdKill.Args)
if err := cmdKill.Run(); err != nil {
p.logger.Warningf("failed to kill pod %s, probably the execution terminated earlier", containerName)
p.logger.Infof("failed to kill pod %s, probably the execution terminated earlier", containerName)

Choose a reason for hiding this comment

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

This one's tough without knowing the full context. If this is routine and expected, maybe it should be downgraded to debug. Maybe there should be more analysis of the response to determine whether "execution terminated earlier" (which is probably not worth logging at all) or whether the attempt failed for some other reason (which might warrant a warning or even error).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a good thing, so debug or no logging.
In reality it should check to see if the container is still running instead of blindly killing it.

@jaredoconnell
Copy link
Contributor

I'm closing this for another PR that addresses the source of the issue.
I actually had commented out these messages locally. No wonder I thought I took care of it.

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.

3 participants