Skip to content

fix(service): the redeliver row outlives its App JWT and halts the Service #7925

Done

Description

@dan-petty

Problem Description

The status row redeliver halts the roadmap Service, so each job of each repository stops. Two defects cause this.

  1. redeliver_failed_deliveries (src/devops_cli/github/hook_redelivery.py) signs one App JWT and uses it for the list request and for each attempt of the round. The JWT is valid for 600 s at most (gidgethub.apps.get_jwt), and the session paces each write. A round that lasts longer gets HTTP 401, which the Service reads as a refused identity.
  2. The deliveries of /app/hook/deliveries belong to the App, but the row runs for each repository of service.repos with a ledger of its own. Each repository asks for each redelivery again, which multiplies the requests and the length of each round.

Reproduction Steps

  1. Run the Service for 9 repositories while the App has about 30 failed deliveries.
  2. Wait 10 minutes.

Expected vs Actual Behavior

Expected: the App asks for each redelivery one time in a round, each request has a valid JWT, and one refused delivery does not stop the others.

Actual: each repository asks for each redelivery. About 600 s after the rounds start, GitHub answers HTTP 401, the Service writes service-halt.json, and no round starts again.

Environment Diagnostics

roadmap Service in the cluster, 2026-11-30 UTC. Evidence from Loki, Tempo and Prometheus.

Logs, Traces, or Terminal Output

  • 19:09:20: 8 spans service.row redeliver start. A ninth starts at 19:10:18.
  • Each of the 9 spans ends with an error 600 s to 618 s after its start.
  • devops_cli_github_requests_total{row="redeliver"}: 9 GET with status 200, 110 POST with status 202, 9 POST with status 401.
  • 19:19:25: redeliver: GitHub refused the session's token for POST /app/hook/deliveries/<id>/attempts (HTTP 401), then the identity halt.
  • 19:26: each of the 9 ledgers held the same 32 pending ids.

Refs #4560 (the row), #7911 (the 403 rate-limit class), #7920 (no cap and no page limit of the row).

Activity

  1. added
    type/bug
    source/agent
    status/new
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The Service halts and no round starts again, so all jobs of all repositories stop.
  3. added
    effort/medium
    value/high
    scope/service
    priority/p0-critical
    owner/agent
    on Nov 30, 2026
  4. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    From the review of the fix of #7911. Offline tests with the fake GitHub API on the head of that fix, with the clock of the JWT moved forward:

    • The retry of a rate-limited attempt sends the same JWT again. When the retry wait is longer than the life of the JWT, the resend gets 401, and redeliver_failed_deliveries raises GitHubUnauthenticatedError.
    • A hold of the hourly request budget gives the same result for the first GET.
    • So the session must ask for a new JWT for each attempt, after the wait of that attempt. One new JWT for each rest call is not enough.

    The fix of #7911 changes a 403 with a rate-limit message from a halt into up to 2 resends, each after 60 s or more. These waits add to the age of the JWT. A release that holds the fix of #7911 and not the fix of this issue can still halt the Service.

  5. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 30, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 30, 2026
  7. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-30 22:54 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalscope/servicesource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions