Skip to content

fix[notask]: dispatch runs now cancel previous same-branch run#2809

Open
tobi-legan wants to merge 1 commit into
mainfrom
fix/dispatch-concurrency
Open

fix[notask]: dispatch runs now cancel previous same-branch run#2809
tobi-legan wants to merge 1 commit into
mainfrom
fix/dispatch-concurrency

Conversation

@tobi-legan

Copy link
Copy Markdown
Contributor

Summary

  • The concurrency group fallback used github.run_id for non-PR triggers (workflow_dispatch), making every dispatch a unique group. Multiple dispatches on the same branch ran in parallel, all competing for the same DF device slots.
  • Switch to github.ref so same-branch dispatches cancel the previous run. The cancel handler already calls stop-run which frees Device Farm devices immediately.
  • Affects all 16 on-pr-*.yml workflows.

Context

Part of QIP: Reduce LLM Mobile CI Run Time. DF device concurrency is the main bottleneck — shards wait up to 78m for a device during working hours. Duplicate dispatch runs waste device slots and make the queue worse for everyone.

Test plan

  • Trigger two workflow_dispatch runs on the same branch — second should cancel the first
  • Verify stop-run fires on the cancelled run (check cancel-device-farm-runs step)
  • Verify PR-based concurrency still works (new push to same PR cancels old run)
  • Verify dispatches on different branches do NOT cancel each other

Related

Made with Cursor

The concurrency group fallback used github.run_id for non-PR triggers,
making every workflow_dispatch a unique group. Multiple dispatches on
the same branch ran in parallel, competing for the same DF device
slots. Switch to github.ref so same-branch dispatches cancel the
previous run — the cancel handler already calls stop-run which frees
Device Farm devices immediately.

Affects all 16 on-pr-*.yml workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tobi-legan tobi-legan requested review from a team as code owners June 23, 2026 16:24
@github-actions

Copy link
Copy Markdown
Contributor

Review Status

Current Status: ❌ PENDING
Approvals so far: none

Pending reviews: Needs 1 Management or Team Lead, and 1 more from Management, Team Lead, or Member.

@tobi-legan

Copy link
Copy Markdown
Contributor Author

Test Results

Tested by triggering two workflow_dispatch runs on the same branch (fix/dispatch-concurrency) back to back:

  • Run 1 (28040731678): dispatched first → cancelled by Run 2 ✅
  • Run 2 (28040769089): dispatched second → ran (then manually cancelled to free DF devices) ✅

The concurrency group with github.ref correctly identifies same-branch dispatches and cancels the previous run. Before this fix, both would have run in parallel competing for DF device slots.

@github-actions

Copy link
Copy Markdown
Contributor

Tier-based Approval Status

**PR Tier:** TIER1

**Current Status:** ❌ PENDING

**Requirements:**
- 1 Team Member approval ❌ (0/1)
- 1 Team Lead OR Management approval ❌ (0/1)



---
*This comment is automatically updated when reviews change.*

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant