feat(frontend): delete rivet compute pool when its runner config is deleted - #5709
Conversation
|
Stack for rivet-dev/actors
Get stack: change yzpyzolo |
| mutationFn: async (name: string) => { | ||
| await deleteRunnerConfig(name); | ||
| const { managedPools } = | ||
| await parent.client.managedPools.list( |
There was a problem hiding this comment.
🟠 Medium · Find the matching pool beyond the first page
managedPools.list is paginated (the repository's Cloud CLI requests limit=100 and follows pagination.cursor), but this lookup fetches only its first response. If a namespace has enough pools for the target name to be on a later page, the runner config is deleted and find returns nothing, leaving the managed pool running despite this mutation reporting success. Request a sufficiently bounded page or follow cursors until the matching name is found.
ReviewSingle-file change to Correctness: deletion order is not retry-safe
If step 2 fails (network blip, transient API error, etc.), step 1 has already succeeded, so the runner config is gone but the pool is now permanently stranded from the UI perspective. Clicking Delete again in Deleting the pool first, then the runner config, would make the flow idempotent: if the pool delete fails, nothing has changed yet and a retry redoes both steps; if the runner config delete then fails, a retry of Minor: defensive check on an unreachable case const base = engineContext.deleteRunnerConfigMutationOptions();
if (!base.mutationFn) {
throw new Error("engine runner config delete mutation is not configured");
}
Other notes
Overall a small, focused change. The main thing worth addressing before merge is the deletion ordering for retry-safety. |
166b74d to
4804d6b
Compare
c090ba5 to
4316084
Compare
| ...opts, | ||
| mutationKey: base.mutationKey, | ||
| mutationFn: async (name: string) => { | ||
| await deleteRunnerConfig(name); |
There was a problem hiding this comment.
🟠 Medium · Keep the config until pool cleanup starts
The runner config is removed before the managed-pool lookup and delete. A transient Cloud API failure after this line leaves the pool alive but removes the only UI path that can retry its cleanup: retrying the dialog first attempts the now-missing config and fails. Look up and begin deleting the matching pool before deleting its runner config, so any failure leaves a retryable state.
| mutationFn: async (name: string) => { | ||
| await deleteRunnerConfig(name); | ||
| const { managedPools } = | ||
| await parent.client.managedPools.list( |
There was a problem hiding this comment.
🟠 Medium · Find the matching pool beyond the first page
managedPools.list is paginated (the repository's Cloud CLI requests limit=100 and follows pagination.cursor), but this lookup fetches only its first response. If a namespace has enough pools for the target name to be on a later page, the runner config is deleted and find returns nothing, leaving the managed pool running despite this mutation reporting success. Request a bounded page or follow cursors until the matching name is found.
No description provided.