Skip to content

Unexpected pagination behavior #1329

Open

Description

@zakvdm

Describe the bug

I am surprised that the following code does no pagination:

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 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

├── 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

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Jul 23, 2025
  2. ysaito1001 commented on Jul 30, 2025

    @ysaito1001
    Collaborator

    Thank you for bringing this up. I believe what you've described is true; If you we not set a page size by page_size, the MaxResults won't make it into a request (code), in which case it relies on the service’s default behavior to return whatever amount of data, and paginates with NextToken.

    S3 should have the same issue since paginators are code-generated from the common logic of paginator within codegen.

    Will call it out in the paginator's documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions