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
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