Repository navigation
sidecar_client: leave VP stopped when the driver rejects a start - #5237
Merged
Sunil Muthuswamy (sunilmut) merged 1 commit intoNov 25, 2026
Conversation
start_async marked the VP running before the start ioctl and left it that way if the ioctl failed. The sidecar driver rejects a start before starting the CPU, so no completion ever arrived: a later run panicked on the "stopped" assertion and a wait would hang. Return the VP to stopped when the start fails. Move the state transition into SidecarClientState::start_vp so it can be unit tested without the sidecar driver. Test changes: - Add the crate's first unit tests. - Verify a rejected run through the real ioctl leaves the VP reusable. - Verify a rejected start leaves the VP stopped and can be retried. - Verify the VP is marked running before the start request is issued.
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Rollback safety depends on failed start ioctls leaving the CPU unstarted with no completion possible, a contract requiring human confirmation because the driver is absent and /dev/null tests cannot validate it.
No open issues 🎉
What changed in this PR
This PR fixes sidecar VP state handling so a rejected start leaves the VP stopped and reusable, rather than causing a later run to panic or a wait to hang.
Changes:
- Extracts the start transition into
SidecarClientState::start_vp, restoring the stopped state on failure while preserving running-before-start ordering. - Adds regression tests for rejected starts, accessor reuse, and state ordering.
- Adds the Linux test tracing dependency.
| File | Description |
|---|---|
openhcl/sidecar_client/src/lib.rs |
Fixes failed-start state recovery and adds regression tests. |
openhcl/sidecar_client/Cargo.toml |
Adds test_with_tracing as a Linux development dependency. |
Cargo.lock |
Records the new test dependency for sidecar_client. |
Review effort: Balanced
John Starks (jstarks)
approved these changes
Nov 25, 2026
Sunil Muthuswamy (sunilmut)
merged commit Nov 25, 2026
bfaed88
into
microsoft:main
108 of 109 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
start_asyncmarked the VP running before the start ioctl and left it thatway if the ioctl failed. The sidecar driver rejects a start in
sidecar_claimbefore starting the CPU, so no completion ever arrives: alater
runpanicked on the "stopped" assertion and awaitwould hang. TheVP state is shared, so re-acquiring the VP accessor did not reset it.
This change returns the VP to stopped when the start fails. It is still marked
running before the ioctl, because a completion can arrive as soon as the CPU
starts.
To make this unit-testable, the state transition moves unchanged into
SidecarClientState::start_vp, whichstart_asynccalls with the same ioctl.Test changes (the crate's first unit tests):
runthrough the real ioctl (/dev/nullreturnsENOTTY) leavesthe VP stopped and reusable with a re-acquired accessor (failed before).