Commit 646ca0d
authored
chore: split queue and build timeouts, reattach on retry (#8780)
* ci(cloudbuild): split queue and build timeouts, reattach on retry
Unity Cloud Build concurrency settings now leave builds in the queue
for much longer before a builder picks them up. The previous single
GLOBAL_TIMEOUT counted queue + active build time together, so a long
queue could kill an otherwise healthy build, and nick-fields/retry
created a brand-new build that went to the back of the queue.
Changes:
- Replace GLOBAL_TIMEOUT with QUEUE_TIMEOUT (4h) and BUILD_TIMEOUT (3h).
The build clock resets on the queue -> started transition so a long
queue never eats into the active build window.
- Exit 99 on either timeout so nick-fields/retry kicks in (the previous
sys.exit(1) was not retryable).
- On retry, reattach to the persisted build_info.json build if it is
still in queue/active, instead of POSTing a fresh build.
- Adaptive polling: bump cadence to 120s after the status has been
unchanged for 10 minutes, to reduce API noise while queued.
- Log queuedReason on each status change and append a phase-breakdown
table to \$GITHUB_STEP_SUMMARY for visibility on queue pressure.
- Make cancel_build idempotent so the post-failure cancel step does not
fail if Unity already finalised the build.
- Raise the wrapping nick-fields/retry timeout_minutes to 450 and the
job timeout-minutes to 510 so the inner Python budgets are always
the ones that fire first.
- Cancel Unity build also on step failure() so an outer step timeout
no longer leaves a Unity-side build holding a slot.
* chore: preserve queue position on retry and trim verbose comments
Don't cancel on inner QUEUE_TIMEOUT — exit 99 to yield the runner while
the build keeps its Unity Cloud queue slot, so the next nick-fields/retry
attempt reattaches via try_resume_build instead of POSTing a fresh build
that goes to the back of the queue. BUILD_TIMEOUT still cancels.
Seed build_start from Unity's totalTimeInSeconds on reattach so the 3h
BUILD_TIMEOUT measures real wall-clock rather than restarting per attempt.
Add the missing sys.exit(0) after the --cancel branch so the cancel step
no longer falls through into the polling loop.
Trim per-line env comments and section banners from build.py and
build-unitycloud.yml per the project's "no comments by default" rule.
* chore: clean up build_info.json on terminal paths
Explicitly delete build_info.json when:
- run_poll_loop returns a terminal status (success/failure/canceled/unknown)
- BUILD_TIMEOUT cancels the build before exit 99
- --cancel mode finishes cancelling
Only the queue_timeout exit keeps the file, so the next retry attempt
can reattach to the still-queued build.
Also fix utils.delete_build_info to actually be idempotent: it was
printing the "ignoring delete" message and then still calling os.remove
on the missing file, which raises FileNotFoundError.
Per-attempt QUEUE_TIMEOUT (effective global cap = QUEUE_TIMEOUT *
max_attempts) is left as-is — that's the retry-as-patience-extension
design intent.1 parent 20e5256 commit 646ca0d
3 files changed
Lines changed: 266 additions & 72 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
| 416 | + | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
| 441 | + | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
445 | | - | |
| 447 | + | |
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
453 | | - | |
454 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
| |||
793 | 798 | | |
794 | 799 | | |
795 | 800 | | |
796 | | - | |
| 801 | + | |
797 | 802 | | |
798 | | - | |
| 803 | + | |
799 | 804 | | |
800 | 805 | | |
801 | 806 | | |
802 | 807 | | |
803 | | - | |
| 808 | + | |
804 | 809 | | |
0 commit comments