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 SNS throttling error finding SNS topics #96

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

ianoxley
Copy link
Contributor

@ianoxley ianoxley commented Aug 8, 2023

Replace the Aws::SNS::Client#list_topics call with Aws::SNS::Resource#topics when iterating through topics.

The former can be subject to rate limiting, whereas the documentation for the latter makes no mention of it being subject to rate limiting.

Also:

  • Fixes Rubocop warnings in the gemspec
  • Moves the Dockerfile and docker-compose.yml into the project root
  • Update the Dockerfile to bundle from the gemspec rather than declaring gem versions itself

ianoxley added 12 commits August 7, 2023 16:05
Move both files to the project root.

Remove specific gem versions from Dockerfile, and rely on those
specified in the gemspec and Gemfile.

Fix path in GitHub Actions workflow after moving docker-compose.yml.
Use the `Aws::SNS::Resource#topics` to search the topics instead of the
`Aws::SNS::Client#list_topics`. This should hopefully remove the
intermittent AWS SNS throttling error seen on deployment.
@ianoxley ianoxley self-assigned this Aug 8, 2023
@ianoxley ianoxley changed the title Fix SNS throttling error when calling #find_topics Fix SNS throttling error finding SNS topics Aug 8, 2023
adamgeorgeson
adamgeorgeson previously approved these changes Aug 8, 2023
Copy link
Contributor

@adamgeorgeson adamgeorgeson left a comment

Choose a reason for hiding this comment

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

docker-compose up -d
docker exec testrunner bash -c "cd src && bundle install && bundle exec rspec && exit"
docker-compose up -d --build
docker exec testrunner bash -c "bundle exec rspec && exit"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is && exit here to try and control the exit code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know TBH 🤷‍♂️

I did change this to use docker-compose run in dae4e9e instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah, it would have been due to using docker exec, to exit the container.

adamgeorgeson
adamgeorgeson previously approved these changes Aug 8, 2023
jlongridge
jlongridge previously approved these changes Aug 8, 2023
The `client` passed to the constructor looks like it'll be an
eventq `AwsQueueClient` rather than an AWS SNS client. So create the
`Resource` using that client's `#sns` method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants