Closed fraserbenjamin closed 2 months ago
I've created a PR to resolve this issue here https://github.com/bbc/sqs-consumer/pull/485
:tada: This issue has been resolved in version 10.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
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.
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 saySQS receive message failed: The specified queue does not exist
and if there was a connectivity issue you would getSQS 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
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