Skip to content

Retry create state app RPC on failure with exponential backoff#364

Closed
Evrard-Nil wants to merge 3 commits into
Dstack-TEE:masterfrom
Evrard-Nil:app-state-retry-rpc
Closed

Retry create state app RPC on failure with exponential backoff#364
Evrard-Nil wants to merge 3 commits into
Dstack-TEE:masterfrom
Evrard-Nil:app-state-retry-rpc

Conversation

@Evrard-Nil

Copy link
Copy Markdown
Contributor

This pull request introduces reliability improvements to certificate handling and socket file management in the guest agent. The main changes are the addition of exponential backoff retry logic for certificate requests and cleanup of existing Unix socket files or directories before binding. These updates help prevent startup failures due to transient certificate service errors or leftover socket files.

Certificate Request Reliability:

  • Added exponential backoff retry logic (up to 5 attempts) for certificate requests in AppState, DstackGuestRpc, and TappdRpc implementations to handle transient failures gracefully. Retries are logged with warnings and delays increase exponentially. [1] [2] [3] [4]
  • Improved error handling for certificate requests, returning a contextual error if all retries fail. [1] [2] [3]

Socket File Management:

  • Added cleanup logic to remove existing Unix socket files or directories before binding the listener in both run_internal_v0 and run_internal functions, preventing binding errors due to leftover files. [1] [2]

@h4x3rotab

Copy link
Copy Markdown
Contributor

Thanks for your contribution! I will let @kvinwang to review it.

@kvinwang

kvinwang commented Oct 9, 2025

Copy link
Copy Markdown
Collaborator

This doesn't resolve the issue since Docker also creates a directory inside the container.
I am closing this and submitting a PR that resolves the issue in a different way.

@kvinwang kvinwang closed this Oct 9, 2025
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