Repository navigation
fix(core): terminalize permanently stalled tasks through whenExhausted - #713
Conversation
🦋 Changeset detectedLatest commit: 90de484 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit 90de484
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
daa1753 to
3668bbf
Compare
3668bbf to
c0fa0d1
Compare
Add focused coverage for private step queues, archived messages, counters, realtime events, and late callbacks after escalation. Add a deterministic dblink race covering recovery, escalation, and a late completion callback competing for parent locks. Keep the cron comment accurate when both jobs overlap, and refresh the generated migration checksum.
c0fa0d1 to
35ac37a
Compare
Sqruff 0.44.0 rejects whitespace before array brackets. Match the existing compact type spelling so core SQL lint passes without changing schema behavior or migrations.
Apply the unpublished stalled-task escalation migration after the worker startup handshake. Rebuild atlas.sum and run the upgrade fixture from the handshake baseline so databases that already applied it can upgrade without inserting an older migration.
A same-name recovery job under another role made the scalar schedule lookup abort the upgrade. Copy the current role and database’s job schedule and activation in one call. Cover active, paused, and absent recovery alongside a foreign job. Scope the maintenance runbook to those same rows and separate pausing from restoration.
Do not depend on SQL operand evaluation order. Check that escalation cannot see an uncommitted marker and that a failure callback waiting on recovery exhausts the archived task. Drop the test’s committed queue objects as well as its rows so later type generation stays clean.
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-713.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🚀 Production Deployment: Website✅ Successfully deployed to production! 🔗 Production URL: https://pgflow.dev 📝 Details:
Deployed at: 2026-11-24T13:13:36+01:00 |
## Summary ```diff - Prepare the pgflow 0.17.3 worker reliability notes. + Prepare the pgflow 0.18.0 notes with the stalled-task recovery fix and upgrade guidance. ``` The minor changeset in #713 moves the fixed package group to 0.18.0 in the release PR: #709. The article covers pending Supabase starts, task result reporting, and how `whenExhausted` now handles permanently stalled tasks. ## Evidence - **Before:** The preview build omitted the draft article's HTML page. **After:** The website build renders the finished article and resolves its link to the stalled-task backlog check. - Website build, internal links, website lint, and article formatting pass locally. ## Merge Danger **Door:** two-way **Blast Radius:** docs Keep this PR open until 0.18.0 ships. Set the actual publication date before merging; the current date is for the preview. This PR does not release packages or run a database migration.

Summary
Fixes #689. Keeps recovery task locks and the existing failure path in separate transactions.
The existing recovery setup configures both jobs with one interval. On upgrade, escalation inherits the scheduled recovery job's interval and active state for the migration role and current database. If that job is absent, the migration schedules nothing. Historical eligible rows with a marker are included; unmarked queued and terminal tasks stay unchanged.
This branch includes #711 from
main. The escalation migration,20261124094756_pgflow_escalate_permanently_stalled.sql, follows the startup handshake without changing prior migration checksums.Evidence
max_attempts.After: the stall marker exhausts the task without creating synthetic claims. The existing policy handles failure, skip, cascade, and private queue cleanup.
more than one row returned by a subquery used as an expression.After: the upgrade fixtures pass with both owners present and cover active, paused, and absent recovery.
90de4845b.Merge Danger
Door: one-way for data effects after escalation runs. Reverting code does not undo completed transitions or downstream side effects.
Blast Radius: recovery
Historical marked tasks follow the configured exhaustion policy after upgrade. In particular,
skipcan start dependent business work. Inspect the documented backlog before upgrading. If downstream execution must stay paused, pause both scheduled jobs and the relevant workers and callbacks, then restore each saved state. Pausing cron alone does not stop marker-aware failure callbacks. This PR does not run a production database migration.