Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fix state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
sargun committed May 10, 2018
1 parent d03691b commit e63b5a1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions executor/runtime/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,7 @@ func handleEvent(c *runtimeTypes.Container, message events.Message, statusMessag
statusMessageChan <- runtimeTypes.StatusMessage{
Status: runtimeTypes.StatusRunning,
}
return false
case "die":
if exitCode := message.Actor.Attributes["exitCode"]; exitCode == "0" {
statusMessageChan <- runtimeTypes.StatusMessage{
Expand All @@ -1290,7 +1291,7 @@ func handleEvent(c *runtimeTypes.Container, message events.Message, statusMessag
statusMessageChan <- runtimeTypes.StatusMessage{
Status: runtimeTypes.StatusRunning,
}
return true
return false
case "kill":
statusMessageChan <- runtimeTypes.StatusMessage{
Status: runtimeTypes.StatusFailed,
Expand All @@ -1301,9 +1302,11 @@ func handleEvent(c *runtimeTypes.Container, message events.Message, statusMessag
Status: runtimeTypes.StatusFailed,
Msg: fmt.Sprintf("%s exited due to OOMKilled", c.TaskID),
}
default:
log.WithField("taskID", c.ID).Info("Received unexpected event: ", message)
return false
}
log.WithField("taskID", c.ID).Info("Received unexpected event: ", message)
return false
return true
}

const (
Expand Down

0 comments on commit e63b5a1

Please sign in to comment.