Don't log EINVAL when unmount IPC#33329
Conversation
container/container_unix.go
Outdated
There was a problem hiding this comment.
how about something like:
if err := unmount(shmPath); err != nil && !os.IsNotExist(err) {
mounted, _ := mount.Mounted(shmPath); mounted {
// append warning
}
}There was a problem hiding this comment.
On Linux, EINVAL may mean that umount2() was called with an invalid flag value in flags.
We need to use Mounted.
container/container_unix.go
Outdated
There was a problem hiding this comment.
Sorry we may want to go ahead and read this error like
if mounted, mErr := ...; mounted || mErr != nil {
// append err
}Fix moby#33328 Signed-off-by: Jacob Wen <[email protected]>
| } else if shmPath != "" { | ||
| if err := unmount(shmPath); err != nil && !os.IsNotExist(err) { | ||
| warnings = append(warnings, fmt.Sprintf("failed to umount %s: %v", shmPath, err)) | ||
| if mounted, mErr := mount.Mounted(shmPath); mounted || mErr != nil { |
There was a problem hiding this comment.
@cpuguy83 looks like this is now doing the same as mount.Unmount(), only in reverse order (first try syscall.Unmount(), then check if it was mounted - I assume that's a performance optimisation) - should we move that optimisation in mount.Unmount() and use it here?
It looks like the unmount argument for UnmountIpcMounts() is not really needed anymore (it looks like it was was added in 78bd17e to allow different unmount methods in different parts of the code)
There was a problem hiding this comment.
It's really different since we're only checking if it's mounted if the unmount failed, vs only trying to unmount if it is mounted. Checking if it's mounted first is racey... and I wouldn't be surprised if it's technically slower to do it that way.
|
Flaky test on experimental? https://jenkins.dockerproject.org/job/Docker-PRs-experimental/34573/console |
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM - we can discuss / look into the optimisation separate from this PR
|
Instead of parsing the whole |
|
@kolyshkin won't that ignore other reasons for |
|
The other reasons for |
|
Gotcha, thanks! |
|
There are many other places (in particular, |
EINVAL means that the target exists but it is not (yet) a mount point.
See umount2(2).
On freebsd, following errors also lead to EINVAL.
We don't need to handle them in UnmountIpcMounts.
Fix #33328
Signed-off-by: Jacob Wen [email protected]
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)