Skip to content

No retry backoff for sqs in aws_s3 source #22947

@medzin

Description

@medzin

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

aws_s3 source doesn't have any handling or backoff for SQS errors like IAM or 5xx. It will just retry the whole logic without any backoff in a loop, generating a flood of traffic. As this will be a CPU-intensive task, it will also trigger autoscaling if Vector is deployed with it, scaling up the problem 😄 Please see the code below:

async fn run(mut self) {
let shutdown = self.shutdown.clone().fuse();
pin!(shutdown);
loop {
select! {
_ = &mut shutdown => break,
_ = self.run_once() => {},
}
}
}
async fn run_once(&mut self) {
let messages = self.receive_messages().await;
let messages = messages
.inspect(|messages| {
emit!(SqsMessageReceiveSucceeded {
count: messages.len(),
});
})
.inspect_err(|err| {
emit!(SqsMessageReceiveError { error: err });
})
.unwrap_or_default();

In case of error, it will just return an empty Vec, go quickly through the rest of the code, and retry the whole process in a loop (no backoff).

Configuration


Version

0.46.1

Debug Output


Example Data

No response

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: aws_s3Anything `aws_s3` source relatedtype: bugA code related bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions