Skip to content

Don't prevent boot on temp cleanup#2463

Merged
crosbymichael merged 1 commit intocontainerd:masterfrom
crosbymichael:temp-clean
Jul 17, 2018
Merged

Don't prevent boot on temp cleanup#2463
crosbymichael merged 1 commit intocontainerd:masterfrom
crosbymichael:temp-clean

Conversation

@crosbymichael
Copy link
Copy Markdown
Member

Fixes #2462
Fixes #2455

Signed-off-by: Michael Crosby [email protected]

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 13, 2018

Codecov Report

Merging #2463 into master will decrease coverage by 4.25%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2463      +/-   ##
==========================================
- Coverage   49.29%   45.03%   -4.26%     
==========================================
  Files          84       92       +8     
  Lines        7486     9425    +1939     
==========================================
+ Hits         3690     4245     +555     
- Misses       3116     4497    +1381     
- Partials      680      683       +3
Flag Coverage Δ
#linux 49.28% <0%> (-0.01%) ⬇️
#windows 41.33% <ø> (?)
Impacted Files Coverage Δ
mount/temp_unix.go 0% <0%> (ø) ⬆️
oci/spec.go 40% <0%> (-10%) ⬇️
snapshots/native/native.go 43.89% <0%> (-10%) ⬇️
metadata/snapshot.go 45.8% <0%> (-8.96%) ⬇️
archive/compression/compression.go 43.93% <0%> (-8.9%) ⬇️
content/local/writer.go 52.63% <0%> (-7.37%) ⬇️
archive/tar.go 43.05% <0%> (-6.95%) ⬇️
metadata/containers.go 47.97% <0%> (-6.62%) ⬇️
metadata/images.go 58.46% <0%> (-4.7%) ⬇️
metadata/buckets.go 56.33% <0%> (-4.6%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8baeaff...0105959. Read the comment docs.

Comment thread mount/temp_unix.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Log the error? It may be lost if the last unmount succeeds

Maybe move the log here instead ? I was going to suggest to return for other kinds of error, but I can only think of EPERM, ENOENT & EINVAL as possible other errors which we may want to ignore on boot too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i'm debating this, I don't really want to put logging in the mount pkg but...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can either continue on any error, aggregate them and return; Or return for any error immediately. :) It doesn't seem good to silently skip unix.EBUSY.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we can just keep on wrapping it otherwise :)

@Random-Liu
Copy link
Copy Markdown
Member

@crosbymichael Should we cherry-pick this?

@crosbymichael
Copy link
Copy Markdown
Member Author

@Random-Liu probably in a 1.1.3 for next week or later. This is more of an issue on the ubuntu 16.04 kernels

@Random-Liu
Copy link
Copy Markdown
Member

Random-Liu commented Jul 13, 2018

@crosbymichael Sure. And what will happen if we fail to umount the temp mount? Will it affect any containerd functionality?

If not, should we just log the error in main.go?

@Random-Liu
Copy link
Copy Markdown
Member

If not, should we just log the error in main.go?

NVM, you are already doing so.

@crosbymichael
Copy link
Copy Markdown
Member Author

Ok, what do you both think about this solution?

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

LGTM

return errors.Wrap(err, "unmounting temp mounts")
warnings, err := mount.CleanupTempMounts(0)
if err != nil {
log.G(ctx).WithError(err).Error("unmounting temp mounts")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we still want err to return here?Looks like the only case where we would get an error is if getmntinfo returns an error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ya, i think this is fine

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@crosbymichael crosbymichael merged commit ed69729 into containerd:master Jul 17, 2018
@crosbymichael crosbymichael deleted the temp-clean branch July 17, 2018 14:27
@AkihiroSuda
Copy link
Copy Markdown
Member

Was this cherry-picked?

@crosbymichael
Copy link
Copy Markdown
Member Author

@AkihiroSuda no

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.

6 participants