Skip to content

Presubmit job stuck in In Progress after Buildbucket build completes #194452

Open

Description

@mdebbar

In #193736 (commit 2c407ee8ca34e4eff0ffd50d32bbb8f0e5cbb4f6), the presubmit dashboard shows Linux windows_android_aot_engine as In Progress, even though the Buildbucket build succeeded ~11 minutes after starting. All 17 other builds in the engine stage finished and are marked Succeeded (including 7 builds that completed later), so the engine stage never transitions to the fusion test stage and Dashboard Checks stays queued indefinitely.

Cocoon processed the STARTED Pub/Sub notification for the build (start_time and build_id are populated on the presubmit_jobs document), but dropped the COMPLETED notification:

  • SubscriptionHandler.service acquires a 24-hour cache lock (cache.setIfNotExists) before running the handler. If the first delivery is still in flight when Pub/Sub redelivers the message (for example, while Scheduler._markUnifiedCheckRunConclusion is retrying Firestore transaction contention on presubmit_guards when several builds finish around the same time), the redelivery sees !lockAcquired and returns 200 OK. Pub/Sub treats that 200 OK as a permanent ACK and never redelivers the message if the first request subsequently fails or times out.
  • Once a presubmit completion notification is lost, nothing recovers it: VacuumStaleTasks only reconciles post-submit tasks (leaving PresubmitJob.updateFromBuild unused), and RerunFailedJob only allows re-running failed jobs.

To resolve this, we need two changes in flutter/cocoon:

  1. Don't return 200 OK from SubscriptionHandler.service while an earlier delivery is still in flight (return a retriable non-2xx status on in-flight lock contention, only persist the 24-hour processed marker after the handler succeeds, and clear the in-flight lock in finally on failure).
  2. Reconcile stale In Progress presubmit jobs against Buildbucket (similar to VacuumStaleTasks for post-submit) and pass completed builds through Scheduler.processBuildCompleted so stage transitions and GitHub check runs recover automatically if a Pub/Sub notification is ever missed.

Activity

  1. added
    team-infraOwned by Infrastructure team
    infra: cocoonRelated to the dashboard or cocoon server
    on Oct 15, 2026
  2. mdebbar commented on Oct 15, 2026

    @mdebbar
    ContributorAuthor

    Happy to send some PRs if that helps.

  3. added
    P1High-priority issues at the top of the work list
    triaged-infraTriaged by Infrastructure team
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listinfra: cocoonRelated to the dashboard or cocoon serverteam-infraOwned by Infrastructure teamtriaged-infraTriaged by Infrastructure team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions