Repository navigation
Fix queued deployment visibility and lifecycle - #4146
M-Hassan-Raza wants to merge 23 commits into
Conversation
|
Just noticed there was a conflict in the branch, have rebased now. Hope this PR gets a look, it looks like a common slop PR from the looks and size (size is mainly just the db snapshot) of it but I did test the code and refactored where I could see some slopification happeneing |
59ca5ef to
c059ef6
Compare
|
resolved another set of conflicts, might abandon this PR cuz it seems to be too big to be merged/reviewed (understandable even if most of the line are just snapshot file) or just not a priority atm |
|
@greptileai review this.. |
| const redisContainerId = containerId.trim(); | ||
|
|
||
| await execAsync(`docker exec -i ${redisContainerId} redis-cli flushall`); | ||
| await cancelDeploymentsByStatus(["queued"]); |
There was a problem hiding this comment.
Cleanup Cancels New Deployments
If a deployment is queued after Redis is flushed but before this database update runs, its BullMQ job survives while its deployment row is marked as cancelled. The worker can only transition rows from queued to running, so it rejects the cancelled row and aborts a valid deployment request.
|
@M-Hassan-Raza are you active ready to fix few missing things? |
Yeah whatever changes are required I can take a look |
|
Hey @M-Hassan-Raza The deployment queue system has changed since your PR. BullMQ was replaced with an in memory queue for self hosted deployments and Inngest for cloud deployments. BullMQ is still used for scheduled backups, just not deployments. If you revisit this, key things to check:
For reference, my attempts at this: #4774 was the first attempt and was closed due to scope issues. #5422 had the self hosted side working with race condition fixes, but I am closing it because the cloud side was missing. Let me know if you want to collaborate on this. |
|
Also check issue #4762 |
c059ef6 to
14f0e25
Compare
14f0e25 to
dd622dc
Compare
Closes #4072
Waiting application, Compose, and preview deployments appear immediately in history and keep the same attempt ID through execution. Queued logs switch to live output when execution starts, preview cards show the latest attempt, and waiting work preserves active-build visibility.
The web server and workers share one typed job contract. Atomic claims prevent duplicate execution; cloud dispatch is persisted with the attempt and recovered through Inngest. Queue cleanup cancels a snapshot of waiting IDs, preserving concurrent submissions and running builds. Webhooks return an error when enqueueing fails.
Rebased onto current canary. Migration 0198_queued_deployments follows upstream's 0197_logs_and_metrics; the upstream migration and snapshot are preserved.
Local validation:
Cloud rollout requires draining old runs, applying migration 0198, and upgrading the web server and deployment API together. Running cloud builds cannot be interrupted through queue cancellation. Upgrade and rollback requirements are documented in apps/api/README.md.