deploy_webgateway returns Ok before substrate ack — D-27 incomplete (same race #119/#120 fixed for deploy_vm/delete_vm) #126

Closed
opened 2026-05-25 15:00:48 +00:00 by mik-tf · 0 comments
Owner

deploy_webgateway at crates/my_compute_zos_server/src/cloud/rpc.rs:2146-2322 spawns the on-chain deploy in tokio::task::spawn and returns Ok immediately, violating D-27. The error arm flips the local row to Error but does not call rollback_orphans, so when the spawned task fails after substrate has minted the deployment + name contracts, both leak on chain. Name contracts are global per twin on TFChain, so a leak burns the requested name until the operator manually cancels it.

Same race that hero_compute#119 + #120 closed for deploy_vm + delete_vm. Fix follows the same pattern: inline block_on_async(timeout(300s, ...)) around the deploy future, with rollback_orphans on Err/Elapsed and inline cancel_on_tfgrid on the save-after-substrate failure path.

Caught during admin-on-TFGrid planning.

`deploy_webgateway` at `crates/my_compute_zos_server/src/cloud/rpc.rs:2146-2322` spawns the on-chain deploy in `tokio::task::spawn` and returns `Ok` immediately, violating D-27. The error arm flips the local row to `Error` but does not call `rollback_orphans`, so when the spawned task fails after substrate has minted the deployment + name contracts, both leak on chain. Name contracts are **global per twin** on TFChain, so a leak burns the requested name until the operator manually cancels it. Same race that hero_compute#119 + #120 closed for `deploy_vm` + `delete_vm`. Fix follows the same pattern: inline `block_on_async(timeout(300s, ...))` around the deploy future, with `rollback_orphans` on `Err`/`Elapsed` and inline `cancel_on_tfgrid` on the save-after-substrate failure path. Caught during admin-on-TFGrid planning.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_compute#126
No description provided.