Skip to content

Commit

Permalink
acs: return an empty task when task is not recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
haikuoliu committed Jul 24, 2018
1 parent e428453 commit 36e6c06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/acs/handler/payload_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ func (payloadHandler *payloadRequestHandler) handleUnrecognizedTask(task *ecsacs
TaskARN: *task.Arn,
Status: apitaskstatus.TaskStopped,
Reason: UnrecognizedTaskError{err}.Error(),
// The real task cannot be extracted from payload message, so we send an empty task.
// This is necessary because the task handler will not send an event whose
// Task is nil.
Task: &apitask.Task{},
}

payloadHandler.taskHandler.AddStateChangeEvent(taskEvent, payloadHandler.ecsClient)
Expand Down

0 comments on commit 36e6c06

Please sign in to comment.