Skip to content

fix(service): cap redelivery POSTs and page the backlog - #8026

Merged
dan-petty merged 2 commits into
mainfrom
fix/7920-the-redeliver-row-has-no-limit
Dec 1, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/7920-the-redeliver-row-has-no-limit

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

The redeliver row sent one POST for each pending guid, read one list
page, and repeated an accepted attempt in each round. About 60 pending
guids used the hourly request budget of the Service, and after a long
stop the row skipped failed deliveries.

  • A round sends at most 40 attempts: the guids with the oldest last
    attempt first, then the oldest delivery ID.
  • A round reads at most 12 list pages back to the delivery cursor. At
    that cap the ledger keeps a page cursor, and the next round continues
    from it. The delivery cursor moves only when the scan ends.
  • Until the scan ends, the ledger keeps the newest success of each guid,
    so an older failure does not make the guid pending again.
  • The ledger records each accepted attempt and is saved after each
    answered one. The row asks again only when GitHub lists a newer delivery
    of the guid.
  • GitHubSession.listing_page reads one listing page with the token of
    the caller.

Closes #7920

Change: openspec/changes/archive/2026-12-01-7920-the-redeliver-row-has-no-limit/

@devops-cli-service devops-cli-service Bot added type/docs Type docs: a change to the documents scope/spec labels Dec 1, 2026
@devops-cli-service devops-cli-service Bot changed the title docs(spec): plan #7920 Cap redelivery POSTs and page the backlog fix(service): Cap redelivery POSTs and page the backlog Dec 1, 2026
@devops-cli-service devops-cli-service Bot added type/bug Type bug: the code does not do what it must scope/service The long-running devops Service and its lanes and removed type/docs Type docs: a change to the documents scope/spec labels Dec 1, 2026
@devops-cli-service
devops-cli-service Bot force-pushed the fix/7920-the-redeliver-row-has-no-limit branch from ab5dc26 to b174a44 Compare December 1, 2026 10:29
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Stopped at fix. The stop report is on #7920: #7920 (comment).

  • tools: run_command 40, read_file 13, grep 8, edit_file 8
  • scoped check pre-push: failed, 44 s
  • scoped check tests: the changed files select more than 30 test modules, so only the changed test modules ran. The required checks of CI run the others
  • fail-to-pass of group 1: fails on the base commit. Tests that fail on the base commit: tests.github.test_github_session::test_a_listing_page_gives_the_page_and_its_next_url_with_the_caller_token.
  • fail-to-pass of group 2: fails on the base commit. Tests that fail on the base commit: tests.github.test_hook_redelivery::test_a_round_sends_at_most_40_attempts_and_leaves_the_rest_unattempted, tests.github.test_hook_redelivery::test_an_accepted_attempt_gets_no_second_attempt_while_no_newer_entry_is_listed, tests.github.test_hook_redelivery::test_a_newer_failed_entry_clears_the_accepted_record_and_gets_one_attempt, tests.github.test_hook_redelivery::test_a_rate_limit_on_the_40th_attempt_keeps_39_accepted_records, tests.github.test_hook_redelivery::test_the_cap_rotates_over_the_pending_set_by_last_attempt_then_delivery_id, tests.github.test_hook_redelivery::test_a_second_round_on_the_same_ledger_file_sends_no_attempt_for_an_accepted_guid.
  • fail-to-pass of group 3: fails on the base commit. Tests that fail on the base commit: tests.github.test_hook_redelivery::test_a_backlog_past_the_page_cap_stores_the_page_cursor_and_keeps_the_delivery_cursor, tests.github.test_hook_redelivery::test_a_backlog_read_to_the_cursor_records_every_delivery_and_clears_the_page_cursor, tests.github.test_hook_redelivery::test_a_success_on_an_older_page_does_not_clear_a_newer_failure_of_the_same_guid, tests.github.test_hook_redelivery::test_a_round_after_the_page_cap_continues_from_the_stored_page_cursor, tests.github.test_hook_redelivery::test_a_newer_success_is_not_undone_by_an_older_failure_on_a_later_round, tests.github.test_hook_redelivery::test_the_ledger_holds_no_success_record_after_the_scan_ends.
  • verify of group 4: uv run devops ci docs exits 0.
\u2139 Quality gate root: /run/roadmap/work/model-clone
\u2713 All documentation files are up to date.

@dan-petty
dan-petty force-pushed the fix/7920-the-redeliver-row-has-no-limit branch from b174a44 to 45c11d2 Compare December 1, 2026 12:42
@dan-petty dan-petty changed the title fix(service): Cap redelivery POSTs and page the backlog fix(service): cap redelivery POSTs and page the backlog Dec 1, 2026
@dan-petty

Copy link
Copy Markdown
Owner

Check results

Head commit: 45c11d250b0ac40d89ef668f6a5486df4e73a167

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
gitleaks success run
Service Image Tests (shard 4 of 6) success run
Service Image Tests (shard 1 of 6) success run
Service Image Tests (shard 6 of 6) success run
Service Image Tests (shard 5 of 6) success run
Service Image Tests (shard 2 of 6) success run
Service Image Tests (shard 3 of 6) success run
Trivy neutral run
Changed-Test Independence success run
Plan Check skipped run
CodeQL success run
Fail-to-Pass Check success run
PR title / Semantic PR title success run
Semantic PR title success run
Tests on Main skipped run
Test Job Duration skipped run
Semantic PR title success run
Service Image Build success run
Tests & Coverage (shard 4 of 6) success run
Tests & Coverage (shard 1 of 6) success run
Tests & Coverage (shard 2 of 6) success run
Tests & Coverage (shard 6 of 6) success run
Changed-Test Independence (run 3 of 3) success run
Runner Image success run
Changed-Test Independence (run 2 of 3) success run
Design Tokens success run
Static Analysis success run
Changed-Test Independence (run 1 of 3) success run
Docs Site Build success run
Tests & Coverage (shard 3 of 6) success run
Tests & Coverage (shard 5 of 6) success run
Service Image success run
Analyze (python) success run
Analyze (actions) success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/46648904014/job/142647463884

Skipped check: Trivy
Skipped check: Plan Check
Skipped check: Tests on Main
Skipped check: Test Job Duration

@dan-petty

Copy link
Copy Markdown
Owner

Report on the stop of the implement job.

Cause. The pre-push hook devops-ci-pre-push ended at its limit of 40 s (exit 124) on a runner Job with 1 CPU. The step fix could change no file. #8005 gives such a Job 2 CPUs. That fix is in v0.268.4 and is live since 2026-12-01 12:10 UTC, after this stop.

Change. The branch is rebased on main at 2a96623f3. No file of the change is different. The new head is 45c11d250. The title and the body now tell what the change does. The pre-push hook passed on this push.

Local checks after the rebase, all passed:

  • devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures,uv-check,deps
  • mypy --strict on the four changed source files
  • pytest -n 4 tests/github: 1560 tests
  • devops ci test on test_hook_redelivery.py, test_github_session.py and test_roadmap_status_rows.py: 117 tests

Review. The diff agrees with the acceptance criteria of #7920 and with the tasks of the change folder. I found no defect that stops the merge.

Open points. This change does not fix these two points.

  1. The Service can refuse a delivery each time, for example with HTTP 403 unmanaged repository. GitHub then lists a new failed delivery after each accepted attempt. The row asks again, and the 3-day limit starts again with the new delivery. The cap of 40 attempts limits the cost of one round, but the repeats do not end. The code before this change did the same.
  2. The row keeps its 404 rule for the delivery list. If GitHub answered 404 for a stored page cursor, the row would keep that cursor and return 0 in each round. This is from the code only. I did not see it, and I did not test it against GitHub.

@dan-petty
dan-petty marked this pull request as ready for review December 1, 2026 12:57
@dan-petty
dan-petty merged commit 313e89f into main Dec 1, 2026
40 of 41 checks passed
@dan-petty
dan-petty deleted the fix/7920-the-redeliver-row-has-no-limit branch December 1, 2026 12:58
dan-petty-release Bot added a commit that referenced this pull request Dec 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.269.1](v0.269.0...v0.269.1)
(2026-12-01)


### Bug Fixes

* **service:** cap redelivery POSTs and page the backlog
([#8026](#8026))
([313e89f](313e89f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/service The long-running devops Service and its lanes type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(service): the redeliver row has no limit on its requests

1 participant