Skip to content

fix(aws_s3 source, aws_sqs source): cap poll_secs at AWS limit of 20#25270

Open
st-omarkhalid wants to merge 1 commit intovectordotdev:masterfrom
st-omarkhalid:fix/22934-sqs-poll-secs-range
Open

fix(aws_s3 source, aws_sqs source): cap poll_secs at AWS limit of 20#25270
st-omarkhalid wants to merge 1 commit intovectordotdev:masterfrom
st-omarkhalid:fix/22934-sqs-poll-secs-range

Conversation

@st-omarkhalid
Copy link
Copy Markdown

Summary

Fixes #22934. Both the aws_s3 source's sqs.poll_secs and the aws_sqs source's poll_secs are forwarded to AWS SQS's ReceiveMessage API as the WaitTimeSeconds parameter, which is hard-capped at 20 seconds by AWS. Setting a higher value silently breaks ingestion (AWS rejects the call; Vector logs nothing user-visible) and the field documentation gave no hint of the limit.

This PR:

  • Adds #[configurable(validation(range(max = 20)))] to both fields so vector validate rejects out-of-range configs before startup.
  • Updates the field doc comments to state the AWS-imposed 0-20s range explicitly, with a link to the AWS API reference.
  • Regenerates the component CUE files (website/cue/reference/components/sources/generated/aws_s3.cue and aws_sqs.cue) via make generate-docs so the user-facing docs surface the new prose. (Per the established pattern, e.g. decrease_ratio in adaptive_concurrency, validation(range(...)) is reflected in user docs as prose; the numeric constraint itself is enforced via the JSON schema.)

The aws_sqs source is included alongside aws_s3 because it has the identical bug at src/sources/aws_sqs/config.rs:50src/sources/aws_sqs/source.rs:111. Happy to split into two PRs if maintainers prefer.

Vector configuration

Existing aws_s3/aws_sqs configurations are unchanged in behavior for any value 0..=20; values >20 will now fail config validation with a clear schema error instead of silently breaking at runtime.

How did you test this PR?

All checks run inside the official timberio/vector-dev:latest Docker image (linux/amd64 under emulation on Apple Silicon, with OPENSSL_NO_VENDOR=1 to use the image's system OpenSSL):

  • cargo check -p vector --no-default-features --features sources-aws_s3,sources-aws_sqs — clean (1m 40s)
  • cargo clippy -p vector --no-default-features --features sources-aws_s3,sources-aws_sqs -- -D warnings — clean (1m 12s, no warnings)
  • cargo nextest run -p vector --no-default-features --features sources-aws_s3 -E "test(/sources::aws_s3/)"6 passed, 0 failed
  • cargo nextest run -p vector --no-default-features --features sources-aws_sqs -E "test(/sources::aws_sqs/)"3 passed, 0 failed
  • make check-generated-docs — clean post-make generate-docs and commit of the regenerated CUE files

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

A validation(range(max = 20)) only rejects configurations that were already broken at runtime against AWS's API; valid configurations are unaffected.

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

Changelog fragment added: changelog.d/22934_sqs_poll_secs_range_validation.fix.md.

References

Closes vectordotdev#22934.

Both the `aws_s3` source's `sqs.poll_secs` and the `aws_sqs` source's
`poll_secs` configuration fields are forwarded to AWS SQS's
`ReceiveMessage` API as the `WaitTimeSeconds` parameter, which AWS hard-
caps at 20 seconds. Setting a higher value caused AWS to reject the
request and surfaced to users as silent ingestion failure with no error
message and no hint in the documentation.

Add a `validation(range(max = 20))` constraint to both fields so that:

- The auto-generated component reference docs surface the 0-20 range
  in prose (matching the established pattern for other validated
  numeric fields, e.g. `decrease_ratio` in adaptive_concurrency).
- `vector validate` rejects out-of-range configs before startup.

Update the field doc comments to state the AWS-imposed limit explicitly,
with a link to the AWS API reference. Regenerate the corresponding
component CUE docs via `make generate-docs`.
@st-omarkhalid st-omarkhalid requested review from a team as code owners April 26, 2026 03:43
@github-actions github-actions Bot added work in progress domain: sources Anything related to the Vector's sources domain: external docs Anything related to Vector's external, public documentation labels Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation Update sqs.poll_sec

1 participant