awslabs / awslabs/aws-sdk-rust
Unexpected pagination behavior
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 290
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 3
Description
### Describe the bug
I am surprised that the following code does no pagination:
```rust
let mut output = ec2_client.describe_instances().into_paginator().send();
// Only ever makes 1 request; no MaxResults parameter is present on the request.
```
I had to explicitly set max results via `.page_size(i32)` on the paginator. The [pagination docs](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/paginating.html) seem to say that it's sufficient to call `.into_paginator()`. I'm not sure if this is a difference between the EC2 & S3 SDK or if the documentation is just misleading for all SDKs.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Expected Behavior
I would expect some default page size to be set by `.into_paginator()` otherwise many users will be surprised (as we were) that they're not making paginated requests.
### Current Behavior
No pagination if you only call `.into_paginator()` (with `.page_size`).
### Reproduction Steps
I confirmed this by turning on tracing debug logging and observing the before and after requests being maide by the SDK once I added `.page_size`.
### Possible Solution
This is either a bug (my expectation) or it's a documentation issue.
### Additional Information/Context
_No response_
### Version
```text
├── aws-config v1.8.1
│ ├── aws-credential-types v1.2.3
│ │ ├── aws-smithy-async v1.2.5
│ │ ├── aws-smithy-runtime-api v1.8.1
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-types v1.3.2
│ │ ├── aws-smithy-types v1.3.2 (*)
│ ├── aws-runtime v1.5.8
│ │ ├── aws-credential-types v1.2.3 (*)
│ │ ├── aws-sigv4 v1.3.3
│ │ │ ├── aws-credential-types v1.2.3 (*)
│ │ │ ├── aws-smithy-http v0.62.1
│ │ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ │ ├── aws-smithy-types v1.3.2 (*)
│ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.1 (*)
│ │ ├── aws-smithy-runtime v1.8.3
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-http v0.62.1 (*)
│ │ │ ├── aws-smithy-http-client v1.0.6
│ │ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ │ ├── aws-smithy-protocol-test v0.63.4
│ │ │ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ │ ├── aws-smithy-types v1.3.2 (*)
│ │ │ │ │ │ ├── aws-lc-rs v1.13.1
│ │ │ │ │ │ │ ├── aws-lc-sys v0.29.0
│ │ │ │ │ │ │ ├── aws-lc-rs v1.13.1 (*)
│ │ │ ├── aws-smithy-observability v0.1.3
│ │ │ │ └── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-types v1.3.7
│ │ │ ├── aws-credential-types v1.2.3 (*)
│ │ │ ├── aws-smithy-async v1.2.5 (*)
│ │ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ │ ├── aws-smithy-types v1.3.2 (*)
│ ├── aws-sdk-sso v1.74.0
│ │ ├── aws-credential-types v1.2.3 (*)
│ │ ├── aws-runtime v1.5.8 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.1 (*)
│ │ ├── aws-smithy-json v0.61.4
│ │ │ └── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-smithy-runtime v1.8.3 (*)
│ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-types v1.3.7 (*)
│ ├── aws-sdk-ssooidc v1.75.0
│ │ ├── aws-credential-types v1.2.3 (*)
│ │ ├── aws-runtime v1.5.8 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.1 (*)
│ │ ├── aws-smithy-json v0.61.4 (*)
│ │ ├── aws-smithy-runtime v1.8.3 (*)
│ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-types v1.3.7 (*)
│ ├── aws-sdk-sts v1.76.0
│ │ ├── aws-credential-types v1.2.3 (*)
│ │ ├── aws-runtime v1.5.8 (*)
│ │ ├── aws-smithy-async v1.2.5 (*)
│ │ ├── aws-smithy-http v0.62.1 (*)
│ │ ├── aws-smithy-json v0.61.4 (*)
│ │ ├── aws-smithy-query v0.60.7
│ │ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-smithy-runtime v1.8.3 (*)
│ │ ├── aws-smithy-runtime-api v1.8.1 (*)
│ │ ├── aws-smithy-types v1.3.2 (*)
│ │ ├── aws-smithy-xml v0.60.10
│ │ ├── aws-types v1.3.7 (*)
│ ├── aws-smithy-async v1.2.5 (*)
│ ├── aws-smithy-http v0.62.1 (*)
│ ├── aws-smithy-json v0.61.4 (*)
│ ├── aws-smithy-runtime v1.8.3 (*)
│ ├── aws-smithy-runtime-api v1.8.1 (*)
│ ├── aws-smithy-types v1.3.2 (*)
│ ├── aws-types v1.3.7 (*)
├── aws-sdk-ec2 v1.144.0
│ ├── aws-credential-types v1.2.3 (*)
│ ├── aws-runtime v1.5.8 (*)
│ ├── aws-smithy-async v1.2.5 (*)
│ ├── aws-smithy-http v0.62.1 (*)
│ ├── aws-smithy-json v0.61.4 (*)
│ ├── aws-smithy-query v0.60.7 (*)
│ ├── aws-smithy-runtime v1.8.3 (*)
│ ├── aws-smithy-runtime-api v1.8.1 (*)
│ ├── aws-smithy-types v1.3.2 (*)
│ ├── aws-smithy-xml v0.60.10 (*)
│ ├── aws-types v1.3.7 (*)
├── aws-smithy-runtime v1.8.3 (*)
├── aws-smithy-types v1.3.2 (*)
```
### Environment details (OS name and version, etc.)
MacOS
### Logs
_No response_
Contributor guide
Research direction
Start by reading the pagination documentation linked in the issue and inspecting the EC2 describe_instances entry point and its into_paginator() behavior. Reproduce the request with tracing, both with and without page_size(i32), then determine whether the documentation or paginator behavior is inconsistent. Done means the expected pagination behavior is established and the issue between the docs and implementation is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100