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

Cleanup the symantics of ACS Handler #3225

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

aws-gibbskt
Copy link
Contributor

@aws-gibbskt aws-gibbskt commented May 25, 2022

Summary

The ACS handler was using a channel to support looping, but the
channel was only sent to from the current thread via a go routine
that would just write to the channel.

The rewrite maintains the behavior of always connecting when
disconnected potentially after a retry backoff. However it uses
a simple endless for loop rather than reading from channels to
mimic this straightforward behavior.

The rewrite also adheres to the interface contract on returning
the error from the context if it is Done for any reason other
than cancelled.

Testing

Added additional tests to validate that all paths reconnect or exit when Context is Error or Cancelled, with appropriate returns. No additional testing outside of Unit/Functional tests.

Licensing

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

nodir-t
nodir-t previously approved these changes May 26, 2022
agent/acs/handler/acs_handler.go Show resolved Hide resolved
agent/acs/handler/acs_handler.go Outdated Show resolved Hide resolved
angelcar
angelcar previously approved these changes May 26, 2022
@aws-gibbskt aws-gibbskt dismissed stale reviews from angelcar and nodir-t via d602deb June 1, 2022 19:37
@aws-gibbskt aws-gibbskt force-pushed the ecs_handler_cleanup branch from f9a4b7b to d602deb Compare June 1, 2022 19:37
@aws-gibbskt aws-gibbskt force-pushed the ecs_handler_cleanup branch 3 times, most recently from b821046 to ee71db1 Compare June 6, 2022 16:24
@sparrc sparrc added the bot/test label Jun 7, 2022
@aws-gibbskt aws-gibbskt force-pushed the ecs_handler_cleanup branch 2 times, most recently from d573d0c to 6af628b Compare June 13, 2022 16:25
@aws-gibbskt aws-gibbskt force-pushed the ecs_handler_cleanup branch from 6af628b to 6478cde Compare June 29, 2022 20:08
@yinyic yinyic requested a review from a team as a code owner September 29, 2022 20:48
@aws-gibbskt aws-gibbskt force-pushed the ecs_handler_cleanup branch from 6478cde to 871e3c7 Compare March 7, 2023 19:00
The ACS handler was using a channel to support looping, but the
channel was only sent to from the current thread via a go routine
that would just write to the channel.

The rewrite maintains the behavior of always connecting when
disconnected potentially after a retry backoff. However it uses
a simple endless for loop rather than reading from channels to
mimic this straightforward behavior.

The rewrite also adheres to the interface contract on returning
the error from the context if it is Done for any reason other
than cancelled.
@sparrc sparrc merged commit b8f0060 into aws:dev Mar 16, 2023
@YashdalfTheGray YashdalfTheGray mentioned this pull request Mar 28, 2023
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.

7 participants