Fix the issue when docker exec a paused container, it will always hang.

Add the test case of this issue.

Docker-DCO-1.1-Signed-off-by: Chen Chao <cc272309126@gmail.com> (github: cc272309126)
Upstream-commit: 1bb02117db80e75f406f6c63d8d50680c1569019
Component: engine
This commit is contained in:
cc272309126
2014-11-28 00:08:39 +08:00
parent 22351497b2
commit 2b487e0de2
3 changed files with 76 additions and 1 deletions

View File

@ -98,7 +98,9 @@ func (d *Daemon) getActiveContainer(name string) (*Container, error) {
if !container.IsRunning() {
return nil, fmt.Errorf("Container %s is not running", name)
}
if container.IsPaused() {
return nil, fmt.Errorf("Container %s is paused, unpause the container before exec", name)
}
return container, nil
}