Repository navigation
Open
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listinfra: cocoonRelated to the dashboard or cocoon serverRelated to the dashboard or cocoon serverteam-infraOwned by Infrastructure teamOwned by Infrastructure teamtriaged-infraTriaged by Infrastructure teamTriaged by Infrastructure team
Description
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.serviceacquires 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, whileScheduler._markUnifiedCheckRunConclusionis retrying Firestore transaction contention onpresubmit_guardswhen several builds finish around the same time), the redelivery sees!lockAcquiredand returns200 OK. Pub/Sub treats that200 OKas 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:
VacuumStaleTasksonly reconciles post-submittasks(leavingPresubmitJob.updateFromBuildunused), andRerunFailedJobonly allows re-running failed jobs.
To resolve this, we need two changes in flutter/cocoon:
- Don't return
200 OKfromSubscriptionHandler.servicewhile 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 infinallyon failure). - Reconcile stale
In Progresspresubmit jobs against Buildbucket (similar toVacuumStaleTasksfor post-submit) and pass completed builds throughScheduler.processBuildCompletedso stage transitions and GitHub check runs recover automatically if a Pub/Sub notification is ever missed.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listinfra: cocoonRelated to the dashboard or cocoon serverRelated to the dashboard or cocoon serverteam-infraOwned by Infrastructure teamOwned by Infrastructure teamtriaged-infraTriaged by Infrastructure teamTriaged by Infrastructure team
Activity
mdebbar commentedon Oct 15, 2026
Happy to send some PRs if that helps.