Skip to content

[STACKED on #874] fix(kms): return Finish response before shutdown - #875

Open
kvinwang wants to merge 3 commits into
codex/fix-kms-private-key-permissionsfrom
codex/fix-kms-finish-response-order
Open

[STACKED on #874] fix(kms): return Finish response before shutdown#875
kvinwang wants to merge 3 commits into
codex/fix-kms-private-key-permissionsfrom
codex/fix-kms-finish-response-order

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

STACKED PR — merge #874 first.

Problem

The KMS Finish handler exited the process before Rocket had sent the RPC response. The onboarding client saw an EOF/connection reset and could not tell whether finalization succeeded.

Root cause and fix

Produce the unit JSON response first and schedule shutdown after it is transmitted.

Implementation

The branch records the following focused implementation work:

  • fix(kms): return Finish response before exit
  • fix(rpc): emit empty JSON unit responses
  • fix(kms): shut down after Finish response

Changed paths:

  • dstack/kms/src/main.rs
  • dstack/kms/src/onboard_service.rs
  • dstack/ra-rpc/src/rocket_helper.rs

Scope

This PR addresses one logical kms 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-kms-private-key-permissions..origin/codex/fix-kms-finish-response-order: 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.

kvinwang added 3 commits July 31, 2026 02:48
Defect: Onboard.Finish terminated the process inside the RPC handler before Rocket could flush the documented Empty response.

Observed symptom: clients received RemoteDisconnected and the graceful-response regression failed.

Fix: return success immediately and schedule process exit after a short response-drain interval.
Copilot AI review requested due to automatic review settings July 31, 2026 02:52

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.

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