Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
fix: remove maxRetries because it does odd things
Browse files Browse the repository at this point in the history
in testing this property changes behaviour in strange way
setting it seems to prevent errors from surfacing at all).
seems to be an issue with aws sdk.
  • Loading branch information
sadams committed Sep 29, 2020
1 parent 248bbd5 commit b92d49e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions src/createHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function createHandler(config) {
currentRegion,
awsEndpoint,
backoffSeconds = 30,
awsClientMaxRetries,
enabled = true,
// we split currentRegion from sqsRegion to solve https://github.com/localstack/localstack/issues/2982
sqsRegion = currentRegion,
Expand All @@ -19,7 +18,6 @@ function createHandler(config) {
const sqsClient = new SQS({
region: sqsRegion,
endpoint: awsEndpoint,
maxRetries: awsClientMaxRetries,
});

async function invokeHandler(handler, message, messageMetadata) {
Expand Down
4 changes: 1 addition & 3 deletions test/createHandler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function nockReceiveError(queueUrl, times = 1) {
)}&Version=2012-11-05&VisibilityTimeout=30&WaitTimeSeconds=1`
)
.times(times)
.replyWithError('something awful happened');
.reply(400, 'eg bad queue url');
return {
scope,
};
Expand Down Expand Up @@ -262,8 +262,6 @@ tap.test('should backoff and resume for errors', (t) => {
backoffSeconds: 1,
longPollSeconds: 1,
currentRegion: 'us-east-1',
// otherwise we have to nock enough errors to get past the aws sdk's automatic retrying.
awsClientMaxRetries: 0,
});
let handlerCalls = 0;
handler.addQueueHandler(queueUrl, (msg) => {
Expand Down

0 comments on commit b92d49e

Please # to comment.