Repository navigation
fix(cold-store-reaper): bound the Drive and S3 listing loops (#6602) - #6717
Merged
Merged
Conversation
…ken page stream fails loudly instead of looping forever (#6602) list_backups and s3_list_objects already refused stuck/repeated continuation tokens, but a stream of fresh tokens paged forever (both loops probed still running at a 300-page sentinel). Add LIST_MAX_PAGES (10_000) and LIST_MAX_RESULTS (1_000_000) — orders of magnitude above any legitimate backup folder/bucket — checked per page in both loops, raising ColdStoreError naming the listing. Three regression tests drive fresh-token streams into both bounds.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
3 tasks
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6602
Problem
list_backups(Drive) ands3_list_objects(S3) inpkgs/cold-store-reaper/cold_store.pyrefused stuck/repeated continuation tokens (the #2426/#1632 guards) but had no page or result bound: a stream of fresh tokens pages forever. Reproduced in triage on the real module with stubbed transports — both listings still looping at a 300-page sentinel.Fix
Module-level
LIST_MAX_PAGES = 10_000andLIST_MAX_RESULTS = 1_000_000(Drive pages hold 1000 entries, S3 pages up to 1000 keys, so legitimate backup folders/buckets sit orders of magnitude below), checked once per page in both loops. Crossing either raisesColdStoreErrornaming the listing (files.list for backups of db …/list of <bucket>) — the same loud-failure shape as the existing stuck-token guards.Tests
Laptop,
pkgs/cold-store-reaper: fulltests.test_cold_storesuite 115 tests OK (1 skipped), including 3 new regression tests:LIST_MAX_PAGESfetches, error naming the db;LIST_MAX_RESULTS);Existing finite-page (
test_list_backups_follows_drive_pages,test_list_pagination) and stuck-token tests stay green.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.