1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libcontainerd
Lei Jitang 32e0ea346b Fix docker restart panic on machine ungracefully shutdown
Machine ungracefully shutdown leaves a lot of container has a
Running=true state.

```
$ cat config.v2.json | jq .

    "Running": true,
    "Paused": false,
    "Restarting": false,

```

And the next docker start will fail with panic.

```

time="2016-12-01T01:54:45.086446715-05:00" level=warning msg="libcontainerd: client is out of sync, restore was called on a fully synced container (49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a)."
time="2016-12-01T01:54:45.087046004-05:00" level=warning msg="libcontainerd: failed to retrieve container 49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a state: rpc error: code = 2 desc = containerd: container not found"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5db7f3]

goroutine 57 [running]:
panic(0x16a8e60, 0xc420010130)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/docker/docker/libcontainerd.(*client).Restore(0xc4202e1a40, 0xc420415000, 0x40, 0xc42015a0b0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/docker/libcontainerd/client_linux.go:457 +0x553
github.com/docker/docker/daemon.(*Daemon).restore.func1(0xc4201c46f0, 0xc4202581e0, 0xc4201c46e8, 0xc42047bfb0, 0xc42047bf80, 0xc42047bf50, 0xc42024ba10, 0xc420512c00)
        /go/src/github.com/docker/docker/daemon/daemon.go:205 +0x198
created by github.com/docker/docker/daemon.(*Daemon).restore
        /go/src/github.com/docker/docker/daemon/daemon.go:260 +0x7bb

```

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 267422e4d0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:40:44 -08:00
..
client.go Lock all calls to hcsshim to prevent close races 2016-09-19 12:59:02 -07:00
client_linux.go Fix docker restart panic on machine ungracefully shutdown 2016-12-01 13:40:44 -08:00
client_solaris.go Add expected 3rd party binaries commit ids to info 2016-11-09 07:42:44 -08:00
client_unix.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
client_windows.go Merge pull request #27955 from mlaventure/runc-docker-info 2016-11-10 21:27:14 -08:00
container.go Remove restartmanager from libcontainerd 2016-10-07 12:09:54 -07:00
container_unix.go Fix race on sending stdin close event 2016-11-22 11:25:33 -08:00
container_windows.go Windows: Plumb through user 2016-11-08 17:41:56 -08:00
oom_linux.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
oom_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
pausemonitor_unix.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
process.go
process_unix.go Ignore "failed to close stdin" if container or process not found 2016-11-30 14:09:19 -08:00
process_windows.go Stop returning errors that should be ignored while closing stdin 2016-11-08 18:25:43 -08:00
queue_unix.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
remote.go
remote_unix.go fix a typo 2016-11-18 13:28:11 -08:00
remote_windows.go
types.go Add expected 3rd party binaries commit ids to info 2016-11-09 07:42:44 -08:00
types_linux.go add lock in libcontainerd client AddProcess 2016-10-02 00:36:25 +08:00
types_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
types_windows.go Windows: Support credential specs 2016-10-06 09:32:22 -07:00
utils_linux.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
utils_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
utils_windows.go Windows: Support credential specs 2016-10-06 09:32:22 -07:00
utils_windows_test.go Allow windows environment variables to contain = 2016-09-05 08:49:07 +10:00