Public: anyone can read this; the crew can change it.

Sentinel: 2 deploy runs wait with no slot being used #17123

opened this

Merged 40h 56m ago, live in production

Cancelling a running deploy now ends its bring-up and frees the deploy slot. This is a guess at the cause: I never had the live run table, so I couldn't see why the two queued runs stayed queued. The gate, tsc and my new test pass, and the tests around the change (deploy-permit-ceiling, deploy-orphan-boot) pass.

Notes

opened this

Cancelling a running deploy now ends its bring-up and frees the deploy slot. This is a guess at the cause: I never had the live run table, so I couldn't see why the two queued runs stayed queued. The gate, tsc and my new test pass, and the tests around the change (deploy-permit-ceiling, deploy-orphan-boot) pass. I did not run the full suite, so nothing outside those has been checked.

Cause. cancelRepoRun marks the run's row cancelled and then calls stopRun(runId). A deploy never registered itself with stopRun, so the call did nothing. The row said "cancelled" while the deploy kept holding its permit and its environment's queue. The sentinel then saw nothing running and two deploys queued behind it.

Change (src/apps/runtime_deploy.ts):

  • execute now registers the deploy's abort controller by run id while it works, and drops it when it ends. A cancel aborts the bring-up in flight.
  • A deploy aborted that way, whose row already says cancelled, ends as cancelled and says so in its log. It no longer tries to mark itself failed.

Test. test/deploy-cancel-frees-slot.test.ts starts a deploy and cancels it with cancelRepoRun. It checks that:

  • the bring-up's abort signal fires;
  • the row stays "cancelled by alice";
  • the next deploy gets the permit.

Without the registration, the deploy never ends and the test times out.

Left out:

  • A cancel that lands while a deploy is still waiting for its permit, or for a previous bring-up to settle, isn't interrupted. It ends when that wait does.
  • Deploys already stuck on a running forge are not cleaned up. Boot already cancels stale queued deploys (#16964).

To try: start a deploy, cancel it from the run page, and the next queued deploy starts right away.

Reused: the existing stopRun/trackRun registry in src/runs/stoppable.ts. I didn't write a new function, so I didn't run similar.ts.

Both doors: the commit says "No door: the cancel already exists on every surface".

Closes #16948

commented

Cancelling a running deploy now ends its bring-up and frees the deploy slot. This is a guess at the cause: I never had the live run table, so I couldn't see why the two queued runs stayed queued. The gate, tsc and my new test pass, and the tests around the change (deploy-permit-ceiling, deploy-orphan-boot) pass. I did not run the full suite, so nothing outside those has been checked.

Cause. cancelRepoRun marks the run's row cancelled and then calls stopRun(runId). A deploy never registered itself with stopRun, so the call did nothing. The row said "cancelled" while the deploy kept holding its permit and its environment's queue. The sentinel then saw nothing running and two deploys queued behind it.

Change (src/apps/runtime_deploy.ts):

  • execute now registers the deploy's abort controller by run id while it works, and drops it when it ends. A cancel aborts the bring-up in flight.
  • A deploy aborted that way, whose row already says cancelled, ends as cancelled and says so in its log. It no longer tries to mark itself failed.

Test. test/deploy-cancel-frees-slot.test.ts starts a deploy and cancels it with cancelRepoRun. It checks that:

  • the bring-up's abort signal fires;
  • the row stays "cancelled by alice";
  • the next deploy gets the permit.

Without the registration, the deploy never ends and the test times out.

Left out:

  • A cancel that lands while a deploy is still waiting for its permit, or for a previous bring-up to settle, isn't interrupted. It ends when that wait does.
  • Deploys already stuck on a running forge are not cleaned up. Boot already cancels stale queued deploys (#16964).

To try: start a deploy, cancel it from the run page, and the next queued deploy starts right away.

Reused: the existing stopRun/trackRun registry in src/runs/stoppable.ts. I didn't write a new function, so I didn't run similar.ts.

Both doors: the commit says "No door: the cancel already exists on every surface".

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs