Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: ListBucketsForProjects pagination broken, causes infinite loop #14915

Open
BrandonY opened this issue Jan 2, 2025 · 0 comments
Open
Assignees
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@BrandonY
Copy link
Contributor

BrandonY commented Jan 2, 2025

What component of google-cloud-cpp is this related to?

Storage

Describe the bug

Iterating over the result of ListBucketsForProjects repeats the first 1000 results forever.

To Reproduce Steps to reproduce the behavior:

  1. Create a GCS project with 1001 buckets in it.
  2. Run this code:
  for (auto&& bucket_metadata : client.ListBucketsForProject(project_id)) {
    if (!bucket_metadata) throw std::move(bucket_metadata).status();
    std::cout << bucket_metadata->name() << "\n";
  }

This will print out the same 1000 bucket names in an infinite loop.

Expected behavior Program prints out 1001 bucket names and halts.

Operating system: Debian 6.1.106-3

What compiler and version are you using? Bazel

What version of google-cloud-cpp are you using? google-cloud-cpp-2.33.0

@BrandonY BrandonY added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 2, 2025
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants