Skip to content

Commit

Permalink
Merge pull request #15709 from Mashimiao/state-separate-part-of-SetRe…
Browse files Browse the repository at this point in the history
…starting

daemon/state: separate part of SetRestarting to setRestarting
  • Loading branch information
Jessie Frazelle committed Aug 21, 2015
2 parents 9d22c7a + a6ed990 commit 9b8cfb6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion daemon/state.go
Expand Up @@ -207,6 +207,11 @@ func (s *State) setStopped(exitStatus *execdriver.ExitStatus) {
// in the middle of a stop and being restarted again
func (s *State) SetRestarting(exitStatus *execdriver.ExitStatus) {
s.Lock()
s.setRestarting(exitStatus)
s.Unlock()
}

func (s *State) setRestarting(exitStatus *execdriver.ExitStatus) {
// we should consider the container running when it is restarting because of
// all the checks in docker around rm/stop/etc
s.Running = true
Expand All @@ -217,7 +222,6 @@ func (s *State) SetRestarting(exitStatus *execdriver.ExitStatus) {
s.OOMKilled = exitStatus.OOMKilled
close(s.waitChan) // fire waiters for stop
s.waitChan = make(chan struct{})
s.Unlock()
}

// setError sets the container's error state. This is useful when we want to
Expand Down

0 comments on commit 9b8cfb6

Please sign in to comment.