BUG: Race condition between manual deploy and webhook deploy on same app #38
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#38
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
File:
internal/service/deploy/deploy.golines ~220-240,internal/handlers/app.goHandleAppDeploy,internal/service/webhook/webhook.gotriggerDeploymentDescription
The per-app deployment lock (
tryLockApp) correctly prevents concurrent deploys for the same app. However, when a deploy is rejected withErrDeploymentInProgress:In
HandleAppDeploy(manual deploy): The error is logged but the user is immediately redirected to the deployments page. The user sees no indication that the deploy was rejected — it looks like it was accepted.In
triggerDeployment(webhook): The error is logged but the webhook event is never marked asprocessed = true, and no retry mechanism exists. The deployment is silently lost.Suggested Fix
?error=deployment_in_progressskippedstatus for webhook eventswebhook-triggered deploys should cancel the deploy in progress, and start a new one. make me a PR