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

taskresources: set terminal reason msg for all errors #2004

Merged
merged 2 commits into from
Apr 29, 2019

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Apr 25, 2019

closes #1631

Summary

This adds a terminal reason to all relevant errors in taskresources

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@petderek petderek left a comment

Choose a reason for hiding this comment

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

Neat!

// terminalReason should be set for resource creation failures. This ensures
// the resource object carries some context for why provisoning failed.
terminalReason string
terminalReasonOnce sync.Once
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats the rationale for including the sync.Once?

Copy link
Contributor

Choose a reason for hiding this comment

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

hm it was in the existing codepaths that populated the terminalReason string. need to dig into the old ones to figure out why we added that in the first place 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

sigh, noting outside of This field does not accept updates. here

im thinking since its a public setter for terminal reason, we didn't want the field clobbered once it's been set

Copy link
Contributor

@adnxn adnxn left a comment

Choose a reason for hiding this comment

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

do you think we should amend the related task resource tests? so we're checking for terminal string in tests that would have the terminalReason populated.

@sparrc
Copy link
Contributor Author

sparrc commented Apr 26, 2019

do you think we should amend the related task resource tests? so we're checking for terminal string in tests that would have the terminalReason populated.

yes I will add unit tests 👍

@sparrc sparrc changed the title taskresources: set terminal reason msg for all errors [WIP] taskresources: set terminal reason msg for all errors Apr 26, 2019
@sparrc sparrc changed the title [WIP] taskresources: set terminal reason msg for all errors taskresources: set terminal reason msg for all errors Apr 26, 2019
closes aws#1631

return a default terminal reason

remove terminalReason code for cgroups based on PR review

Test that volume errors are propogated
Copy link
Contributor

@adnxn adnxn left a comment

Choose a reason for hiding this comment

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

changes lgtm, thanks for fixing/updating those tests.

@sparrc sparrc merged commit 42b883e into aws:dev Apr 29, 2019
@sparrc sparrc deleted the terminal-reason branch April 29, 2019 21:58
fierlion added a commit to fierlion/amazon-ecs-agent that referenced this pull request Apr 30, 2019
Updating to go 1.12

Make CGroups CPU period configurable

Signed-off-by: Mohamad Arab <boynux@gmail.com>

taskresources: set terminal reason msg for all errors (aws#2004)

* taskresources: set terminal reason msg for all errors

closes aws#1631

return a default terminal reason

remove terminalReason code for cgroups based on PR review

Test that volume errors are propogated

* fix cleanup error test and add string check

Fix telemetry test for ws2019

On WS2019 functional test image mcr.microsoft.com/windows/servercore:ltsc2019,
the behavior to handle path changed from ws2016 image, it needs to set entrypoint with
absolute path or have entrypoint set to powershell to run executable without absolute path.
Also removed unused binary in windows telemetry test.

add storageReadBytes storageWriteBytes stats
fierlion pushed a commit to fierlion/amazon-ecs-agent that referenced this pull request Apr 30, 2019
* taskresources: set terminal reason msg for all errors

closes aws#1631

return a default terminal reason

remove terminalReason code for cgroups based on PR review

Test that volume errors are propogated

* fix cleanup error test and add string check
@sparrc sparrc added this to the 1.28.0 milestone May 8, 2019
@fenxiong fenxiong mentioned this pull request May 9, 2019
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.

5 participants