Skip to content

[STACKED on #883] fix(util): stage certificate and key together - #902

Closed
kvinwang wants to merge 3 commits into
codex/fix-guest-atomic-credentialsfrom
codex/fix-util-atomic-cert-key
Closed

kvinwang wants to merge 3 commits into
codex/fix-guest-atomic-credentialsfrom
codex/fix-util-atomic-cert-key

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

STACKED PR — merge #883 first.

Problem

Certificate and private key were replaced as separate writes. A crash or reader between the writes could observe a new certificate paired with the old key, causing TLS loading and handshakes to fail.

Root cause and fix

Stage the matching certificate/key outputs together and publish the pair through an atomic commit sequence.

Implementation

The branch records the following focused implementation work:

  • fix(util): stage certificate and key together

Changed paths:

  • dstack/crates/dstack-cli-core/src/fsutil.rs
  • dstack/dstack-util/src/main.rs

Scope

This PR addresses one logical util finding. It intentionally excludes the acceptance-test infrastructure from #841 and unrelated product fixes from #840.

Dependency and merge order

Verification

  • git diff --check origin/codex/fix-guest-atomic-credentials..origin/codex/fix-util-atomic-cert-key: passed.
  • The declared base was verified as an ancestor of the PR head.
  • Focused compile/check verification was run for the changed component where applicable; non-Rust packaging or configuration changes were reviewed against their exact branch delta.

Copilot AI review requested due to automatic review settings July 31, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang
kvinwang force-pushed the codex/fix-guest-atomic-credentials branch from cfba158 to 83076e6 Compare August 4, 2026 07:49
@kvinwang

kvinwang commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing because staging two files and renaming them sequentially does not make the certificate/key pair atomic: a crash, reader, or second rename failure can still observe a new certificate with the old key. The related #841 case was updated to validate certificate/key binding, permissions, individual output failures, and retry without asserting unsupported two-file transaction semantics.

@kvinwang kvinwang closed this Aug 4, 2026
@kvinwang
kvinwang deleted the codex/fix-util-atomic-cert-key branch August 7, 2026 13:56
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.

2 participants