Files
docker-cli/components/engine/daemon
Lei Jitang 6dce6bba77 Enable inspect exec if container is pause/restarting/non-running
if docker exec exit and at the same the the container is pause,
there could be a chance the `docker exec exit` will fail
```
$ docker exec -ti 388c7f47a06c sh
/ # exit
Error response from daemon: Container 388c7f47a06cce0856266ffd56a2ce2901689ca7a6b9cd741b37652418448f2b is paused, unpause the container before exec
```
To reproduce this error easilly, we can add a sleep in `containerPause`
```
--- a/daemon/pause.go
+++ b/daemon/pause.go
@@ -2,6 +2,7 @@ package daemon

 import (
        "fmt"
+       "time"

        "github.com/docker/docker/container"
 )
@@ -25,7 +26,7 @@ func (daemon *Daemon) ContainerPause(name string) error {
 func (daemon *Daemon) containerPause(container *container.Container) error {
        container.Lock()
        defer container.Unlock()
-
+       time.Sleep(time.Second * 5)
        // We cannot Pause the container which is not running
        if !container.Running {
                return errNotRunning{container.ID}
```

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 0e87588bbb2482f9635a19ac43be1c0ee9652ac2
Component: engine
2017-04-28 05:52:15 -04:00
..
2017-02-07 11:08:37 -08:00
2016-11-14 15:15:09 -05:00
2016-09-07 11:05:58 -07:00
2016-10-28 11:06:54 -07:00
2016-11-16 13:38:45 -08:00
2017-04-03 21:04:40 -04:00
2017-02-15 21:57:27 +08:00
2016-11-03 10:05:11 -07:00
2016-11-03 10:05:11 -07:00
2016-11-03 10:05:11 -07:00
2016-11-17 13:10:48 -05:00
2017-02-07 11:08:37 -08:00
2016-09-07 11:05:58 -07:00
2016-11-08 17:41:56 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-04-11 18:07:15 -04:00
2016-06-27 10:23:37 -07:00
2016-12-27 23:30:50 +08:00
2016-12-01 09:38:08 -08:00
2016-10-06 22:48:53 -03:00
2016-09-07 11:05:58 -07:00
2016-10-27 10:34:38 -07:00
2016-09-13 09:55:35 -04:00
2017-04-10 16:49:43 +02:00
2017-02-15 21:57:27 +08:00
2017-01-11 21:35:59 +08:00
2016-12-27 21:46:52 +08:00
2016-09-07 11:05:58 -07:00
2017-02-01 14:43:58 -05:00
2016-09-21 12:36:52 +02:00
2016-09-16 11:56:15 -07:00
2016-12-27 23:30:50 +08:00
2016-11-21 19:56:01 +08:00