GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(github-backup): paginate queue polling (#3476) by dezren39 · Pull Request #3484 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

GET /queue?cursor=… -> one KV page + cursor/list_complete
                       ↓
drain_queue follows all pages -> existing fetch/ack policy
  • Worker forwards the optional cursor and exposes KV pagination metadata.
  • Drainer collects every page before applying the existing ack policy; incomplete or repeated cursors fail closed.
  • Add Worker route coverage and the 500 retained failures + later healthy event regression. Failed events remain unacked.

Fixes #3476

Evidence

  • Before: github-backup(queue): retained failed events starve polling — /queue returns only the first 500 events with no pagination #3476 documents the 501-event probe: /queue returned the first 500 only, starving the later healthy event.
  • After: python3 infra/github-backup/tests/test_drain_queue.py — 59/59 checks pass; node --test infra/github-backup/worker/test/index.test.mjs — 2/2 pass; git diff --check passes.

Merge Danger

Door: two-way

Blast Radius: narrow

The change affects only the authenticated queue polling response and its drainer. Existing event acknowledgement policy and the 500-item per-page limit are preserved.


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

Summary by CodeRabbit

  • Improvements

    • Queue retrieval now supports pagination, allowing large queues to be processed across multiple pages.
    • Queue acknowledgements are sent in batches, including when processing large numbers of events.
  • Bug Fixes

    • Added safeguards for incomplete or invalid pagination responses to prevent unreliable queue processing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
fix(github-backup): paginate queue polling
21a4e83
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 10:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T07:24:31.565927Z ae02486 New commits
ℹ️ 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The Worker now exposes queue pagination metadata. The drainer follows pages before applying its acknowledgement policy and sends acknowledgements in batches of up to 500 IDs. Tests cover pagination, retained failed events, acknowledgement batches, and unauthenticated requests.

Changes: Queue pagination and draining

Layer / File(s) Summary
Worker queue pagination
infra/github-backup/worker/src/index.js, infra/github-backup/worker/test/index.test.mjs
The /queue endpoint passes an optional cursor to KV listing and returns events with a cursor and list_complete status. Tests check pagination responses and that unauthenticated requests do not call KV list.
Drainer pagination and acknowledgment batches
infra/github-backup/bin/drain_queue.py, infra/github-backup/tests/test_drain_queue.py
The drainer follows pages and validates event data and pagination cursors. It acknowledges IDs in batches of 500. Tests check that a healthy event after 500 failing events is processed and that 1,200 events produce three acknowledgement requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Drainer as drain_queue.py
  participant Worker as GET /queue
  participant KV as GHB_EVENTS
  Drainer->>Worker: Request queue page with cursor
  Worker->>KV: List events with prefix, limit, and cursor
  KV-->>Worker: Return events and pagination metadata
  Worker-->>Drainer: Return events, cursor, and list_complete
  Drainer->>Worker: Request another page when listing is incomplete
  Drainer->>Worker: Acknowledge IDs in batches of up to 500
Loading
Merge Risk: Minimal · up to ae024

The pagination and bounded acknowledgment changes have no established blocking defect. Comparing exact acknowledged IDs would strengthen the batching regression test.

- [ ] 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 1, 2026
github-backup(queue): retained failed events starve polling — /queue returns only the first 500 events with no pagination #3476
Closed
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 1, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21a4e83fa4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread infra/github-backup/bin/drain_queue.py
Comment on lines +87 to +89
events.extend(page_events)
if page.get("list_complete", True):
return events

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Batch acknowledgements after collecting multiple queue pages

When a backlog contains more than 1,000 ackable events, collecting every page makes main() send all their IDs in a single /queue/ack request. That Worker handler performs one awaited KV delete per ID, but Cloudflare limits each invocation to 1,000 KV operations, so the request fails after partially deleting the batch and the drainer exits with an error. Previously, the 500-event polling limit kept acknowledgements below this ceiling. Split acknowledgements into bounded requests so multi-page backlogs can drain successfully.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dezren39 dezren39 Nov 4, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: acknowledgements are now sent through ack_events(), which batches ids at ACK_BATCH_SIZE = 500 per /queue/ack request — well under the Worker's 1,000-KV-operation invocation limit — so multi-page backlogs drain completely instead of failing mid-batch. Regression test in test_drain_queue.py case 15: 1,200 ackable events produce 3 bounded ack requests with every event acked (63/63 checks pass).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot assigned dezren39 Nov 1, 2026
@dezren39

dezren39 commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked (task 8248, lane code-e)

Parking task 8248: the Codex gate blocks merge of PR #3484 — one undispositioned P2 finding, reverified fresh 2026-11-04 (no replies on the thread):

  • drain_queue.py (comment 4435215151) — batch acknowledgements after collecting multiple queue pages: when a backlog contains more than 1,000 ackable events, acks must be batched within KV limits.

Resume condition: fix that finding on PR #3484 (or reply-disposition it with reasoning), then merge when the PR is mergeable and all findings are dispositioned.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

developing-today[bot] added 2 commits November 4, 2026 01:20
developing-today[bot]
fix(github-backup): batch queue acknowledgements under the Worker KV …
c9e95e7
…ceiling (#3476)
developing-today[bot]
Merge remote-tracking branch 'origin/main' into HEAD
ae02486
# Conflicts:
#	infra/github-backup/bin/drain_queue.py
#	infra/github-backup/tests/test_drain_queue.py
@dezren39
dezren39 merged commit 8d26667 into main Nov 4, 2026
1 check failed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/5428-3476-queue-pagination branch November 4, 2026 07:27
@coderabbitai coderabbitai Bot mentioned this pull request Nov 4, 2026
atlas-search(service): bound the results-paging loop — deadline + cursor-progress guard (#5424) #5437
Merged
@developing-today developing-today Bot mentioned this pull request Nov 4, 2026
github-backup(queue): #3476 pagination fix is merged but the Worker was never redeployed — live /queue still returns 500 events with no cursor, drainer blind to ~5.9k queued events #5496
Closed
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

github-backup(queue): retained failed events starve polling — /queue returns only the first 500 events with no pagination

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.