deploy_vm returns Ok before the spawned substrate submission finishes #120
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_compute#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ComputeService.deploy_vm(atcrates/my_compute_zos_server/src/cloud/rpc.rs:1116-1213) returns a successful response carrying avm_sidas soon as the local slice allocation completes, but the substratecreateDeploymentContractcalls run in atokio::spawn'd task that the RPC handler does not await. Callers persist their local state (vm_secret, vm_sid, owner mapping) based on the synchronous Ok return, before the on-chain write has actually landed. If the caller crashes or the network drops between the daemon's Ok response and the caller's own state-write, the spawned task can still create one or two on-chain contracts that the caller no longer has a reference to, costing TFT indefinitely. This is the symmetric twin of issue #119 (delete_vm). Fix: await the spawned submission task and return Ok only after substrate ack lands, or expose an explicit pending state the caller can poll. Seecloud/rpc.rs:1116-1213and the spawned task block at line 1116.Cross-referencing the s156 walk evidence detailed at #119 — the D-27 substrate-await fix at
39d9b8ais incomplete on the error path for both deploy_vm and (by symmetry) delete_vm. The same rollback-on-error pattern that #119 needs on the deploy side is needed on the delete side too: if delete_vm errors after publishing a cancel intent to substrate, the on-chain state may end up half-cancelled with no client-side record. Tracking both fixes together since the structure is identical.Signed-by: mik-tf mik-tf@noreply.invalid