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

Use debug instead of error log for skipped events for internal task/container #3559

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

yinyic
Copy link
Contributor

@yinyic yinyic commented Feb 6, 2023

Summary

For internal tasks (e.g. service connect relay) or internal containers (e.g. pause containers), we do not wish to publish any state change events for them. Currently we log an error message when we encounter such task/container while constructing the events. But that could be noisy and misleading since this is not a real error but rather designed behavior. This PR updates all such error messages to be debug messages.

Implementation details

Created new error type ErrShouldNotSendEvent. This error will be returned for internal task/containers when constructing a state change event. Caller will discern this error, and log a debug instead of error message in that case.

Testing

  • Ran make test
  • Tested updated ECS Agent with service connect task, observed debug logs below
level=debug time=2023-02-06T21:01:52Z msg="Should not send events for internal tasks or containers: ~internal~ecs~pause-server"
level=debug time=2023-02-06T21:01:52Z msg="Should not send events for internal tasks or containers: ~internal~ecs~pause-ecs-service-connect-ciCxr"
level=debug time=2023-02-06T21:01:52Z msg="Should not send events for internal tasks or containers: instance-service-connect-relay"

New tests cover the changes: no

Description for the changelog

Use debug instead of error log for skipped events for internal task/container

Licensing

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

@yinyic yinyic requested a review from a team as a code owner February 6, 2023 21:05
@yinyic yinyic changed the base branch from master to dev February 6, 2023 21:05
@yinyic yinyic added the bot/test label Feb 6, 2023
@yinyic yinyic changed the title "Use debug instead of error log for skipped events for internal task/container Use debug instead of error log for skipped events for internal task/container Feb 6, 2023
@yinyic yinyic assigned yinyic and unassigned yinyic Feb 6, 2023
sparrc
sparrc previously approved these changes Feb 6, 2023
singholt
singholt previously approved these changes Feb 6, 2023
agent/api/statechange.go Outdated Show resolved Hide resolved
@yinyic yinyic merged commit 81034b1 into aws:dev Feb 7, 2023
@yinyic yinyic deleted the stsc-scsc-error-fix branch February 7, 2023 01:16
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.

6 participants