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

[Bug]: When consumer fails to react to SQS instant retry occurs #484

Closed
fraserbenjamin opened this issue Apr 4, 2024 · 3 comments · Fixed by #489
Closed

[Bug]: When consumer fails to react to SQS instant retry occurs #484

fraserbenjamin opened this issue Apr 4, 2024 · 3 comments · Fixed by #489

Comments

@fraserbenjamin
Copy link

Describe the bug

If the consumer cannot connect to SQS due to no internet connection or the unlikely event SQS is down, if pollingWaitTimeMs is 0 (set by default), it will instantly retry the connection causing a continual flurry of requests. There is currently no option to resolve this other than by setting pollingWaitTimeMs to a higher value however this also isn't ideal since it adds a longer wait between polls too. Currently authentication errors are caught and can have a back-off configured with authenticationErrorTimeout though this doesn't exist for general connection errors.

Your minimal, reproducible example

https://stackblitz.com/github/fraserbenjamin/sqs-consumer-starter?file=index.js

Steps to reproduce

Once the application starts you will see the console quickly filled up with error messages saying Could not load credentials from any providers, although if you had credentials available it would then say SQS receive message failed: The specified queue does not exist and if there was a connectivity issue you would get SQS receive message failed: getaddrinfo ENOTFOUND sqs.eu-central-1.amazonaws.com

Expected behavior

As a user I expected these retries to be throttled after a failure but instead I see requests continuously being made and error messages being sent to the console at an excessive rate.

How often does this bug happen?

Every time

Screenshots or Videos

Screenshot 2024-04-04 at 08 49 41

Platform

Occurs on all platforms and tested with the issue happening on Node versions 16-20.

Package version

9.1.0

AWS SDK version

3.547.0

Additional context

No response

@fraserbenjamin
Copy link
Author

I've created a PR to resolve this issue here #485

Copy link

🎉 This issue has been resolved in version 10.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant