Skip to content

Enabling resiliency for open_partition#192

Merged
mhatrevi merged 6 commits intovmhatre/resiliency-stagingfrom
vmhatre/resiliency-open-part
Feb 26, 2026
Merged

Enabling resiliency for open_partition#192
mhatrevi merged 6 commits intovmhatre/resiliency-stagingfrom
vmhatre/resiliency-open-part

Conversation

@mhatrevi
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_macro proc-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 HsmError variants and updates DDI call sites to use the new mapping, enabling open_partition retries.

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.

Comment thread crates/retry_macro/src/lib.rs Outdated
Comment thread crates/retry_macro/src/lib.rs Outdated
Comment thread api/lib/src/retry.rs Outdated
Comment thread api/lib/src/retry.rs Outdated
Comment thread api/lib/src/partition.rs Outdated
Comment thread api/lib/src/ddi/mod.rs Outdated
Comment thread crates/retry_macro/src/lib.rs Outdated
Comment thread crates/retry_macro/src/lib.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@mhatrevi mhatrevi force-pushed the vmhatre/resiliency-open-part branch from 090c143 to d487242 Compare February 22, 2026 17:29
@mhatrevi mhatrevi changed the base branch from vmhatre/resiliency-interfaces to vmhatre/resiliency-staging February 22, 2026 17:30
@mhatrevi mhatrevi force-pushed the vmhatre/resiliency-staging branch from 5a4b908 to 7c2985e Compare February 22, 2026 17:35
@mhatrevi mhatrevi requested a review from Copilot February 22, 2026 17:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated 6 comments.

Comment thread api/tests/src/resiliency/open_part.rs
Comment thread api/tests/cpp/partition_tests.cpp Outdated
Comment thread api/lib/src/resiliency.rs Outdated
Comment thread xtask/src/precheck.rs Outdated
Comment thread ddi/resiliency_mock/src/fault.rs Outdated
Comment thread ddi/res_test_dev/src/fault.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.

Comment thread api/tests/cpp/partition_tests.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.

@mhatrevi mhatrevi marked this pull request as ready for review February 22, 2026 19:43
Comment thread api/lib/src/resiliency.rs
Comment thread ddi/res_test_dev/src/fault.rs
Comment thread api/lib/src/resiliency.rs Outdated
Comment thread api/lib/src/resiliency.rs Outdated
Comment thread api/lib/src/resiliency.rs
Comment thread api/lib/src/resiliency.rs
Comment thread api/tests/src/resiliency/open_part.rs
Comment thread ddi/lib/Cargo.toml Outdated
Comment thread ddi/resiliency/src/dev.rs Outdated
Comment thread api/tests/src/resiliency/open_part.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated no new comments.

Comment thread ddi/res_test_dev/src/fault.rs
@mhatrevi mhatrevi merged commit f02b8fd into vmhatre/resiliency-staging Feb 26, 2026
5 checks passed
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
@mhatrevi mhatrevi deleted the vmhatre/resiliency-open-part branch March 27, 2026 15:15
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.

3 participants