Merge pull request #14259 from mesosphere/sttts-cleanup-task-lost

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-09-21 07:11:48 -07:00
commit 1ad9aad8ab
3 changed files with 4 additions and 3 deletions

View File

@ -717,8 +717,8 @@ func (k *KubernetesExecutor) FrameworkMessage(driver bindings.ExecutorDriver, me
log.Infof("Receives message from framework %v\n", message)
//TODO(jdef) master reported a lost task, reconcile this! @see scheduler.go:handleTaskLost
if strings.HasPrefix(message, "task-lost:") && len(message) > 10 {
taskId := message[10:]
if strings.HasPrefix(message, messages.TaskLost+":") {
taskId := message[len(messages.TaskLost)+1:]
if taskId != "" {
// clean up pod state
k.lock.Lock()

View File

@ -26,6 +26,7 @@ const (
ExecutorShutdown = "executor-shutdown"
LaunchTaskFailed = "launch-task-failed"
TaskKilled = "task-killed"
TaskLost = "task-lost"
UnmarshalTaskDataFailure = "unmarshal-task-data-failure"
TaskLostAck = "task-lost-ack" // executor acknowledgement of forwarded TASK_LOST framework message
Kamikaze = "kamikaze"

View File

@ -441,7 +441,7 @@ func (k *KubernetesScheduler) reconcileTerminalTask(driver bindings.SchedulerDri
//to do anything. The underlying driver transport may be able to send a
//FrameworkMessage directly to the slave to terminate the task.
log.V(2).Info("forwarding TASK_LOST message to executor %v on slave %v", taskStatus.ExecutorId, taskStatus.SlaveId)
data := fmt.Sprintf("task-lost:%s", task.ID) //TODO(jdef) use a real message type
data := fmt.Sprintf("%s:%s", messages.TaskLost, task.ID) //TODO(jdef) use a real message type
if _, err := driver.SendFrameworkMessage(taskStatus.ExecutorId, taskStatus.SlaveId, data); err != nil {
log.Error(err.Error())
}