You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a container successfully mounts an overlay but fails to create an activemount file, the volume ends up in a weird state: the overlay is mounted but the volume is not marked used by anyone:
// We successfully mounted (`syscall.Mount`) the volume but failed to put information about the container
// using the volume. In the worst case (if we just created the volume) the following happens:
// Using the plugin, it is now impossible to unmount the volume (this container is not created, so there's
// no one to trigger `.Unmount()`) and impossible to remove (the directory mountpoint/ is a mountpoint, so
// attempting to remove it will fail with `syscall.EBUSY`).
// It is possible to mount the volume again: a new overlay will be mounted, shadowing the previous one.
// The new overlay will be possible to unmount but, as the old overlay remains, the Unmount method won't
// succeed because the attempt to remove mountpoint/ will result in `syscall.EBUSY`.
//
// Thus, a human interaction is required.
//
// (if it's not us who actually mounted the overlay, then the situation isn't too bad: no new container is
// started, the error is reported to the end user).
log.Criticalf("Failed to create active mount file: %v. If no other container was currently "+
"using the volume, this volume's state is now invalid. A human interaction or a reboot is required",
err)
returnnil, fmt.Errorf("docker-on-top internal error: failed to create an active mount file: %w. "+
"The volume is now locked. Make sure that no other container is using the volume, then run "+
"`unmount %s` to unlock it. Human interaction is required. Please, report this bug",
err, mountpoint)
The situation is not critical: when the next container attempts to mount the same volume, it will just mount a new overlay on top of the old one (and, if it succeeds to create an activemount file, it will continue). In that situation, there are two (several) overlay mounts using the same lowerdir, workdir, and upperdir. Only the topmost overlay may be used by a container, so there shouldn't be a problem... Or should there?
IMO, it would be safer to prevent later mounts of that volume until the overlay is unmounted. To achieve that, one can prepend every mount operation with the recreation of the mountpoint (i.e., rmdir+mkdir). Moreover, I just found that I've already considered this!
If a container successfully mounts an
overlay
but fails to create anactivemount
file, the volume ends up in a weird state: the overlay is mounted but the volume is not marked used by anyone:docker-on-top/driver.go
Lines 233 to 253 in 1bfffce
The situation is not critical: when the next container attempts to mount the same volume, it will just mount a new
overlay
on top of the old one (and, if it succeeds to create anactivemount
file, it will continue). In that situation, there are two (several)overlay
mounts using the samelowerdir
,workdir
, andupperdir
. Only the topmost overlay may be used by a container, so there shouldn't be a problem... Or should there?IMO, it would be safer to prevent later mounts of that volume until the
overlay
is unmounted. To achieve that, one can prepend every mount operation with the recreation of the mountpoint (i.e.,rmdir
+mkdir
). Moreover, I just found that I've already considered this!docker-on-top/volumeTreeManagement.go
Lines 139 to 152 in 1bfffce
The text was updated successfully, but these errors were encountered: