Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/22934_sqs_poll_secs_range_validation.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Constrained the `aws_s3` source's `sqs.poll_secs` and the `aws_sqs` source's `poll_secs` configuration fields to the AWS-imposed maximum of 20 seconds. These fields map to SQS `ReceiveMessage`'s `WaitTimeSeconds` parameter; previously, values above 20 caused AWS to reject the call, manifesting as silent ingestion failure with no error or hint in the documentation. The field documentation now states the limit explicitly, and `vector validate` rejects out-of-range configurations.

authors: st-omarkhalid
7 changes: 7 additions & 0 deletions src/sources/aws_s3/sqs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,18 @@ pub(super) struct Config {
///
/// Generally, this should not be changed unless instructed to do so, as if messages are available,
/// they are always consumed, regardless of the value of `poll_secs`.
///
/// Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is
/// [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in
/// silent ingestion failure, so this field is constrained to the same range.
///
/// [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html
// NOTE: We restrict this to u32 for safe conversion to i32 later.
// NOTE: This value isn't used as a `Duration` downstream, so we don't bother using `serde_with`
#[serde(default = "default_poll_secs")]
#[derivative(Default(value = "default_poll_secs()"))]
#[configurable(metadata(docs::type_unit = "seconds"))]
#[configurable(validation(range(max = 20)))]
pub(super) poll_secs: u32,

/// The visibility timeout to use for messages, in seconds.
Expand Down
7 changes: 7 additions & 0 deletions src/sources/aws_sqs/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@ pub struct AwsSqsConfig {
///
/// Generally, this should not be changed unless instructed to do so, as if messages are available,
/// they are always consumed, regardless of the value of `poll_secs`.
///
/// Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is
/// [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in
/// silent ingestion failure, so this field is constrained to the same range.
///
/// [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html
// NOTE: We restrict this to u32 for safe conversion to i32 later.
// NOTE: This value isn't used as a `Duration` downstream, so we don't bother using `serde_with`
#[serde(default = "default_poll_secs")]
#[derivative(Default(value = "default_poll_secs()"))]
#[configurable(metadata(docs::type_unit = "seconds"))]
#[configurable(metadata(docs::human_name = "Poll Wait Time"))]
#[configurable(validation(range(max = 20)))]
pub poll_secs: u32,

/// The visibility timeout to use for messages, in seconds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,12 @@ generated: components: sources: aws_s3: configuration: {

Generally, this should not be changed unless instructed to do so, as if messages are available,
they are always consumed, regardless of the value of `poll_secs`.

Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is
[capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in
silent ingestion failure, so this field is constrained to the same range.

[aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html
"""
required: false
type: uint: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,12 @@ generated: components: sources: aws_sqs: configuration: {
Generally, this should not be changed unless instructed to do so, as if messages are available,
they are always consumed, regardless of the value of `poll_secs`.
Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is
[capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in
silent ingestion failure, so this field is constrained to the same range.
[aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html
"""
required: false
type: uint: {
Expand Down
Loading