Skip to content

fix(cold-store-reaper): bound the Drive and S3 listing loops (#6602) - #6717

Merged
dezren39 merged 1 commit into
mainfrom
fb-6602-cold-store-page-bound
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fb-6602-cold-store-page-bound

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6602

Problem

list_backups (Drive) and s3_list_objects (S3) in pkgs/cold-store-reaper/cold_store.py refused 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_000 and LIST_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 raises ColdStoreError naming 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: full tests.test_cold_store suite 115 tests OK (1 skipped), including 3 new regression tests:

  • Drive fresh-token stream trips the page bound after exactly LIST_MAX_PAGES fetches, error naming the db;
  • Drive result bound trips (LIST_MAX_RESULTS);
  • S3 fresh-token stream trips the page bound after exactly the capped fetches, error naming the bucket.

Existing finite-page (test_list_backups_follows_drive_pages, test_list_pagination) and stuck-token tests stay green.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 03:11
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea2c5f54-dce5-468b-b85b-51aad62f5be7
Commits

Reviewing files that changed from the base of the PR and between 90a5463 and 2d74bd1.

Files selected for processing: 2

  • pkgs/cold-store-reaper/cold_store.py
  • pkgs/cold-store-reaper/tests/test_cold_store.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T03:12:53.208585Z 2d74bd1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit ff160b9 into main Nov 7, 2026
3 checks passed
@dezren39
dezren39 deleted the fb-6602-cold-store-page-bound branch November 7, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cold-store-reaper(listings): list_backups and s3_list_objects have no page/result bound — a fresh-token page stream loops forever, accumulating rows

1 participant