1
0
mirror of https://github.com/opencontainers/runc.git synced 2025-07-30 17:43:06 +03:00

Fix various state bugs for pause and destroy

There were issues where a process could die before pausing completed
leaving the container in an inconsistent state and unable to be
destoryed.  This makes sure that if the container is paused and the
process is dead it will unfreeze the cgroup before removing them.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2016-01-21 16:43:33 -08:00
parent 27132f2e51
commit 556f798a19
4 changed files with 68 additions and 50 deletions

View File

@ -49,19 +49,13 @@ func TestPausedStateTransition(t *testing.T) {
valid := []containerState{
&pausedState{},
&runningState{},
&stoppedState{},
}
for _, v := range valid {
if err := s.transition(v); err != nil {
t.Fatal(err)
}
}
err := s.transition(&stoppedState{})
if err == nil {
t.Fatal("transition to stopped state should fail")
}
if !isStateTransitionError(err) {
t.Fatal("expected stateTransitionError")
}
}
func TestRestoredStateTransition(t *testing.T) {