Repository navigation
fix(deploy): deferred webhook recreate to survive self-rebuild - #270
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for regal-bunny-0c8efe ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughConverts the webhook container recreation in the deployment script from synchronous foreground execution to asynchronous background execution using nohup. Adds explicit lock-release steps before triggering the background process and updates trap handling to allow the current process to exit without blocking. Changes
Sequence DiagramsequenceDiagram
participant Deploy as Deploy Process
participant Lock as Lock Manager
participant Docker as Docker Compose
participant Webhook as Webhook Container
rect rgba(200, 150, 100, 0.5)
Note over Deploy,Webhook: Previous (Synchronous) Flow
Deploy->>Lock: Check/hold lock
Deploy->>Docker: Recreate container (foreground)
Docker->>Webhook: Recreate & wait
Webhook-->>Docker: Container ready
Docker-->>Deploy: Return (blocking)
Deploy->>Lock: Release lock
Deploy->>Deploy: Exit process
end
rect rgba(100, 150, 200, 0.5)
Note over Deploy,Webhook: New (Asynchronous) Flow
Deploy->>Lock: Check/hold lock
Deploy->>Lock: Explicitly remove lock dir
Deploy->>Deploy: Clear EXIT trap
Deploy->>Deploy: Spawn nohup detached recreate
Deploy->>Lock: Release lock immediately
Deploy->>Deploy: Exit process (non-blocking)
par Background Execution
Docker->>Webhook: Recreate & wait (in background)
Webhook-->>Docker: Container ready
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|



Summary
When
deploy.shruns inside the webhook container (viadeploy-wrapper.sh), thedocker compose up --force-recreate webhookat the end kills the container it's running inside. This leaves the webhook inExited(0)state with a mangled container name, breaking subsequent deploys.Root Cause
deploy.shlines 462-468 randocker compose up -d -V --force-recreate --no-deps webhooksynchronously as the final step. Since the script runs inside the webhook container, this command kills its own host container mid-execution, leaving Docker in an inconsistent state.Fix
docker compose build --no-cache webhook(safe, doesn't kill anything)nohup docker compose up -d -V --force-recreate --no-deps webhook > /dev/null 2>&1 &so the Docker daemon completes it independentlyTesting
After this fix:
Summary by CodeRabbit