-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Fix error handling with not-exist errors on remove #33960
Conversation
72be18d
to
74e28f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ping @tiborvass @tonistiigi PTAL |
ugh, this one is really flaky https://jenkins.dockerproject.org/job/Docker-PRs-WoW-RS1/15435/console
|
74e28f6
to
0b059b7
Compare
Ping |
daemon/graphdriver/aufs/aufs.go
Outdated
@@ -286,6 +286,9 @@ func (a *Driver) Remove(id string) error { | |||
for { | |||
mounted, err := a.mounted(mountpoint) | |||
if err != nil { | |||
if os.IsNotExist(err) { | |||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be break
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we just get another not exist error again later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rename after this seems to already handle it. For the other paths after that, I don't know how we could be sure that they do not exist without checking.
0b059b7
to
6731eaf
Compare
ping @tonistiigi PTAL |
daemon/graphdriver/aufs/aufs.go
Outdated
} | ||
return err | ||
if !os.IsNotExist(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already checked in line 327
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Specifically, none of the graphdrivers are supposed to return a not-exist type of error on remove (or at least that's how they are currently handled). Found that AUFS still had one case where a not-exist error could escape, when checking if the directory is mounted we call a `Statfs` on the path. This fixes AUFS to not return an error in this case, but also double-checks at the daemon level on layer remove that the error is not a `not-exist` type of error. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
6731eaf
to
d42dbdd
Compare
LGTM |
hi, will this PR be backported to even older versions like 1.10 or 1.12? |
@justlaputa this issue is a fair bit more complicated and this also isn't really fixing any long standing issues, just a sticky situation that can occur in 17.06.0. Also the only maintained versions are currently 17.06 and 17.07. |
@cpuguy83 : thanks for your detail explanation, I got the situation. |
Specifically, none of the graphdrivers are supposed to return a
not-exist type of error on remove (or at least that's how they are
currently handled).
Found that AUFS still had one case where a not-exist error could escape,
when checking if the directory is mounted we call a
Statfs
on thepath.
This fixes AUFS to not return an error in this case, but also
double-checks at the daemon level on layer remove that the error is not
a
not-exist
type of error.Addresses a user issue:
#21704 (comment)