Skip to content

Infinite loop in list_objects pagination #7

@ton77v

Description

@ton77v

Bug

list_objects enters an infinite loop when the result set exceeds one page (>1000 objects).

Details

During integration of deltaglider into a project, we noticed that list_objects hangs indefinitely when listing a prefix with more than 1000 objects.

Looking at the debug logs, the internal pagination in list_objects uses StartAfter with deltaglider's internal/encoded keys. S3 doesn't advance past these keys correctly because they don't sort as expected in S3's lexicographic key ordering — so each subsequent list_objects_v2 call returns the same results, looping forever.

The relevant code path: client.list_objects()list_objects_page() (core/object_listing.py) → storage.list_objects() (adapters/storage_s3.py line 144) which calls boto3's list_objects_v2 with the problematic StartAfter.

Reproduction

from deltaglider import create_client

client = create_client(
    aws_access_key_id="...",
    aws_secret_access_key="...",
)

# any prefix with >1000 objects
response = client.list_objects(Bucket="your-bucket", Prefix="some/prefix/", MaxKeys=1000)
# hangs forever

Workaround

Using a raw boto3 client for listing operations bypasses the issue. deltaglider is still used for head_object, generate_presigned_url, etc.

Environment

  • deltaglider 6.1.0
  • Python 3.13
  • Windows 11

🦀 sent by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions