Enabling resiliency for open_partition#192
Merged
mhatrevi merged 6 commits intovmhatre/resiliency-stagingfrom Feb 26, 2026
Merged
Enabling resiliency for open_partition#192mhatrevi merged 6 commits intovmhatre/resiliency-stagingfrom
mhatrevi merged 6 commits intovmhatre/resiliency-stagingfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds retry-with-exponential-backoff support to the Rust API layer and uses it to make HsmPartitionManager::open_partition resilient to transient IO-abort driver errors (e.g., live migration / crash recovery scenarios).
Changes:
- Introduces a new
retry_macroproc-macro crate providing#[retry_with_backoff]. - Adds a retry runtime helper (
api/lib/src/retry.rs) plus an IO-abort predicate. - Maps DDI driver IO-abort errors into dedicated
HsmErrorvariants and updates DDI call sites to use the new mapping, enablingopen_partitionretries.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/retry_macro/src/lib.rs | New #[retry_with_backoff] proc-macro implementation. |
| crates/retry_macro/Cargo.toml | New proc-macro crate manifest. |
| api/lib/src/retry.rs | New retry runtime helper + predicates + unit tests. |
| api/lib/src/partition.rs | Applies retry macro to open_partition; adds resiliency helper method. |
| api/lib/src/lib.rs | Wires in the new retry module. |
| api/lib/src/error.rs | Adds IoAborted / IoAbortInProgress error variants. |
| api/lib/src/ddi/mod.rs | Adds From<DdiError> for HsmError mapping (incl. IO-abort). |
| api/lib/src/ddi/session.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/rsa.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/partition.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/key.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/hmac.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/hkdf.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/ecc.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/dev.rs | Uses map_err(HsmError::from) for DDI errors (incl. open_dev). |
| api/lib/src/ddi/aes_xts_key.rs | Uses map_err(HsmError::from) for DDI errors. |
| api/lib/src/ddi/aes.rs | Uses map_err(HsmError::from) for DDI errors (incl. fast-path calls). |
| api/lib/Cargo.toml | Adds retry_macro dependency. |
| Cargo.toml | Adds crates/retry_macro to workspace + workspace dependency. |
77ee89e to
090c143
Compare
090c143 to
d487242
Compare
5a4b908 to
7c2985e
Compare
d487242 to
45410bf
Compare
45410bf to
c772ab5
Compare
jaygmsft
reviewed
Feb 24, 2026
jaygmsft
reviewed
Feb 24, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 25, 2026
mhatrevi
commented
Feb 26, 2026
ce515ea to
d7ccd07
Compare
jaygmsft
reviewed
Feb 26, 2026
jaygmsft
approved these changes
Feb 26, 2026
mhatrevi
added a commit
that referenced
this pull request
Feb 26, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 4, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 10, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 12, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 13, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 13, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 19, 2026
mhatrevi
added a commit
that referenced
this pull request
Mar 23, 2026
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.
No description provided.