fix(dashmate): container name is already in use#2341
Conversation
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
packages/dashmate/src/listr/tasks/ssl/VerificationServer.js (1)
102-109: Consider adding exponential backoff between retriesWhile the retry logic is solid, adding a small delay between retries could help in scenarios where the container cleanup takes longer than expected.
const MAX_RETRIES = 3; +const RETRY_DELAY_MS = 1000; while (!this.container && retries <= MAX_RETRIES) { try { this.container = await this.docker.createContainer(opts); } catch (e) { // Throw any other error except container name conflict if (e.statusCode !== 409) { throw e; } + // Add exponential backoff + await new Promise(resolve => setTimeout(resolve, RETRY_DELAY_MS * Math.pow(2, retries)));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/dashmate/src/listr/tasks/ssl/VerificationServer.js(2 hunks)
🔇 Additional comments (2)
packages/dashmate/src/listr/tasks/ssl/VerificationServer.js (2)
100-102: LGTM! Well-structured retry mechanism
The implementation of a retry mechanism with a reasonable maximum retry count (3) is a good approach to handle container name conflicts.
111-126: LGTM! Robust error handling for container cleanup
The error handling for container removal and waiting is well implemented:
- Properly handles dangling container removal
- Correctly distinguishes between 404 (container not found) and other errors
- Uses force removal to ensure cleanup succeeds
Issue being fixed or feature implemented
Error during ZeroSSL cert verification:
What was done?
How Has This Been Tested?
Running and canceling cert verification and start again
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes