Skip to content

fix(vmm): run each start to completion even if its request is dropped - #1617

Merged
kvinwang merged 3 commits into
nextfrom
vmm-start-survives-cancel
Nov 18, 2026
Merged

kvinwang merged 3 commits into
nextfrom
vmm-start-survives-cancel

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

A start holds the per-VM launch lock across the supervisor deploy. If the
request future is dropped while that deploy is in flight, the lock goes
with it while the deploy still lands. The next start then reads "not
running", and the supervisor's own check lets its deploy through too: two
QEMUs, one of them untracked, and the second launch's interface sweep can
delete what the first one is using.

Rocket serves HTTP/1 with half-close allowed, so hyper does not watch for
a disconnect there, but an HTTP/2 client (h2c is accepted on the plain
listener) that resets its stream or closes the connection drops the
handler future. The start now runs in its own task and the caller awaits
it, so dropping the caller no longer cancels a launch. Removal already
runs in a spawned task; a dropped stop leaves at most a stop half done,
not a second QEMU.

Signed-off-by: Kevin Wang wy721@qq.com

@kvinwang
kvinwang enabled auto-merge November 18, 2026 11:44
kvinwang added a commit that referenced this pull request Nov 18, 2026
Model #1616 (load_vm and load_or_update_vm auto-starts recheck started
under the launch lock) and #1617 (a start runs in its own task, so a
dropped caller no longer releases the lock mid-launch) as Config
switches that the fixed code has on. stop_sticks and at_most_one_running
now hold for the fixed code without extra assumptions; the old traces
replay the bugs with the switches off.

Signed-off-by: Kevin Wang <wy721@qq.com>
A start holds the per-VM launch lock across the supervisor deploy. If the
request future is dropped while that deploy is in flight, the lock goes
with it while the deploy still lands. The next start then reads "not
running", and the supervisor's own check lets its deploy through too: two
QEMUs, one of them untracked, and the second launch's interface sweep can
delete what the first one is using.

Rocket serves HTTP/1 with half-close allowed, so hyper does not watch for
a disconnect there, but an HTTP/2 client (h2c is accepted on the plain
listener) that resets its stream or closes the connection drops the
handler future. The start now runs in its own task and the caller awaits
it, so dropping the caller no longer cancels a launch. Removal already
runs in a spawned task; a dropped stop leaves at most a stop half done,
not a second QEMU.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the vmm-start-survives-cancel branch from 457ce8c to fa96582 Compare November 18, 2026 11:55
Signed-off-by: Kevin Wang <wy721@qq.com>
The launch creates hda.img with qemu-img, which CI runners lack.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit e8657e4 into next Nov 18, 2026
18 checks passed
@kvinwang
kvinwang deleted the vmm-start-survives-cancel branch November 18, 2026 12:45
kvinwang added a commit that referenced this pull request Nov 18, 2026
Model #1616 (load_vm and load_or_update_vm auto-starts recheck started
under the launch lock) and #1617 (a start runs in its own task, so a
dropped caller no longer releases the lock mid-launch) as Config
switches that the fixed code has on. stop_sticks and at_most_one_running
now hold for the fixed code without extra assumptions; the old traces
replay the bugs with the switches off.

Signed-off-by: Kevin Wang <wy721@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant