Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container change not reported when task status is NONE #1076

Merged
merged 2 commits into from
Nov 15, 2017

Conversation

richardpen
Copy link

@richardpen richardpen commented Nov 14, 2017

Summary

Fix #1075

Implementation details

Task status with NONE is dropped in taskShouldBeSent, this commit makes the taskShouldBeSent more clear and stronger to handle both container event and task event.

Testing

  • Builds on Linux (make release)
  • Builds on Windows (go build -out amazon-ecs-agent.exe ./agent)
  • Unit tests on Linux (make test) pass
  • Unit tests on Windows (go test -timeout=25s ./agent/...) pass
  • Integration tests on Linux (make run-integ-tests) pass
  • Integration tests on Windows (.\scripts\run-integ-tests.ps1) pass
  • Functional tests on Linux (make run-functional-tests) pass
  • Functional tests on Windows (.\scripts\run-functional-tests.ps1) pass
  • Manual test.

New tests cover the changes:
yes

Description for the changelog

Licensing

This contribution is under the terms of the Apache 2.0 License:
yes

@nmeyerhans
Copy link
Contributor

I've tested this with my repro case for #1075 and it passes. Task shows lastStatus: PENDING while some containers are RUNNING and others are PENDING and blocked on image pulls. Containers within the task that are RUNNING have fully populated metadata, while PENDING containers have empty metadata. As containers start, the task object returned by DescribeTasks is populated, such that when the task itself finally transitions to RUNNING all of the containers are fully described. This matches the desired behavior, so from the outside this looks good.

seelog.Warnf("SubmitTaskStateChange called with an invalid change: %s", change.String())
return errors.New("ecs api client: SubmitTaskStateChange called with an invalid change")
}

if change.Status != api.TaskRunning && change.Status != api.TaskStopped && len(change.Containers) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also get rid of this block altogether. This determination should be happening in sendableEvent .taskShouldBeSent method: https://github.com/richardpen/amazon-ecs-agent/blob/fix-1075/agent/eventhandler/task_handler_types.go#L67

@richardpen richardpen merged commit 5752a5e into aws:v1.15.x Nov 15, 2017
@jhaynes jhaynes mentioned this pull request Nov 15, 2017
@richardpen richardpen deleted the fix-1075 branch November 21, 2017 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants