Commit 587b767
committed
fix: prevent cancelled builds from executing by checking updateStatus result
Fixed a race condition where a build could still execute after being
cancelled. The issue was:
1. runBuild checks if build is in terminal state
2. CancelBuild is called, setting status to "cancelled"
3. runBuild calls updateStatus(StatusBuilding) which silently returns
4. runBuild proceeds to executeBuild, wasting compute resources
The fix:
- updateStatus now returns bool indicating if the update was applied
- runBuild checks this return value and aborts if false
- This prevents creating builder VMs for already-cancelled builds1 parent 6fbb831 commit 587b767
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
| |||
603 | 607 | | |
604 | 608 | | |
605 | 609 | | |
606 | | - | |
| 610 | + | |
| 611 | + | |
607 | 612 | | |
608 | 613 | | |
609 | 614 | | |
610 | | - | |
| 615 | + | |
611 | 616 | | |
612 | 617 | | |
613 | 618 | | |
614 | 619 | | |
615 | 620 | | |
616 | 621 | | |
617 | | - | |
| 622 | + | |
618 | 623 | | |
619 | 624 | | |
620 | 625 | | |
| |||
629 | 634 | | |
630 | 635 | | |
631 | 636 | | |
| 637 | + | |
632 | 638 | | |
633 | 639 | | |
634 | 640 | | |
635 | 641 | | |
| 642 | + | |
636 | 643 | | |
637 | 644 | | |
638 | 645 | | |
| |||
0 commit comments