-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update mount state of live containers after a daemon crash.
Fix unmount issues in the daemon crash and restart lifecycle, w.r.t graph drivers. This change sets a live container RWLayer's activity count to 1, so that the RWLayer is aware of the mount. Note that containerd has experimental support for restore live containers. Added/updated corresponding tests. Signed-off-by: Anusha Ragunathan <[email protected]>
- Loading branch information
1 parent
57575a2
commit 511a705
Showing
8 changed files
with
170 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
integration-cli/docker_cli_daemon_not_experimental_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// +build daemon,!windows,!experimental | ||
|
||
package main | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"strings" | ||
|
||
"github.com/go-check/check" | ||
) | ||
|
||
// os.Kill should kill daemon ungracefully, leaving behind container mounts. | ||
// A subsequent daemon restart shoud clean up said mounts. | ||
func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonKill(c *check.C) { | ||
c.Assert(s.d.StartWithBusybox(), check.IsNil) | ||
|
||
out, err := s.d.Cmd("run", "-d", "busybox", "top") | ||
c.Assert(err, check.IsNil, check.Commentf("Output: %s", out)) | ||
id := strings.TrimSpace(out) | ||
c.Assert(s.d.cmd.Process.Signal(os.Kill), check.IsNil) | ||
mountOut, err := ioutil.ReadFile("/proc/self/mountinfo") | ||
c.Assert(err, check.IsNil, check.Commentf("Output: %s", mountOut)) | ||
|
||
// container mounts should exist even after daemon has crashed. | ||
comment := check.Commentf("%s should stay mounted from older daemon start:\nDaemon root repository %s\n%s", id, s.d.folder, mountOut) | ||
c.Assert(strings.Contains(string(mountOut), id), check.Equals, true, comment) | ||
|
||
// restart daemon. | ||
if err := s.d.Restart(); err != nil { | ||
c.Fatal(err) | ||
} | ||
|
||
// Now, container mounts should be gone. | ||
mountOut, err = ioutil.ReadFile("/proc/self/mountinfo") | ||
c.Assert(err, check.IsNil, check.Commentf("Output: %s", mountOut)) | ||
comment = check.Commentf("%s is still mounted from older daemon start:\nDaemon root repository %s\n%s", id, s.d.folder, mountOut) | ||
c.Assert(strings.Contains(string(mountOut), id), check.Equals, false, comment) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters