vmm: return GPU reset errors from VM APIs - #1055
Closed
kvinwang wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves error diagnostics returned from the VMM’s pRPC VM lifecycle APIs by ensuring the full underlying error chain (not just the outer context) is preserved in the error string that crosses the RPC boundary, with a regression test focused on nested GPU reset/sanitization failures.
Changes:
- Added an
rpc_errorhelper to flatten ananyhow::Errorchain into a single error message before returning it via RPC. - Applied the flattened error behavior to both
CreateVmandStartVmAPI paths. - Added a unit test to validate that nested GPU sanitization errors remain visible in the returned error string.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+49
to
+51
| fn rpc_error(context: &str, error: anyhow::Error) -> anyhow::Error { | ||
| anyhow!("{context}: {error:#}") | ||
| } |
Collaborator
Author
|
Closing after verification: the existing pRPC error encoder already serializes the full anyhow error chain, including low-level GPU reset I/O errors such as Permission denied. The proposed flattening was therefore redundant. |
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.
Summary
CreateVmandStartVmMotivation
GPU sanitization added in #1048 can fail before QEMU starts. Some pRPC transports preserve only the outer error's
Displayvalue, causing the actionable PCIe reset failure to be hidden behind a generic VM start error. Flattening the chain at the VMM API boundary ensures clients receive the complete diagnostic.Tests
cargo fmt --all -- --checkcargo test -p dstack-vmm(117 passed)