Skip to content

Commit

Permalink
Merge pull request kubernetes#14259 from mesosphere/sttts-cleanup-tas…
Browse files Browse the repository at this point in the history
…k-lost

Auto commit by PR queue bot
  • Loading branch information
k8s-merge-robot committed Sep 21, 2015
2 parents 979bfc0 + 132f889 commit 1ad9aad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contrib/mesos/pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions contrib/mesos/pkg/executor/messages/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion contrib/mesos/pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 1ad9aad

Please sign in to comment.