Version Packages - #659
Merged
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit f912ccc
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
jumski
force-pushed
the
changeset-release/main
branch
from
September 1, 2026 12:42
dbf34c1 to
53885a0
Compare
jumski
force-pushed
the
changeset-release/main
branch
from
September 2, 2026 01:12
53885a0 to
b1ba4c2
Compare
jumski
added a commit
that referenced
this pull request
Sep 2, 2026
## Summary Fix stalled-task recovery to use the effective step timeout instead of always using the flow timeout. This PR stacks directly on #663 (`09-01-issue_645_failed_run_terminalization`) and preserves its run, step-state, and task eligibility guards. ## Root cause `start_tasks()` sets PGMQ visibility from the effective timeout: ```sql coalesce(step.opt_timeout, flow.opt_timeout) + 2 ``` `requeue_stalled_tasks()` used only `flows.opt_timeout`. A short step timeout could therefore make the PGMQ message visible while its task row remained `started` until the longer flow timeout and recovery buffer expired. ## Behavior Recovery now requires: ```sql started_at < now() - (coalesce(step.opt_timeout, flow.opt_timeout) * interval '1 second') - interval '30 seconds' ``` The comparison stays strict. A null step timeout inherits the non-null flow timeout. The PGMQ-only two-second margin is not added to recovery. Adding it again would change the existing 30-second recovery grace to 32 seconds. The 15-second cron cadence can add up to roughly 15 seconds after eligibility. The change preserves: - `run.status = 'started'`, `step_state.status = 'started'`, and `task.status = 'started'`; - `permanently_stalled_at is null` and `FOR UPDATE OF task SKIP LOCKED` behavior; - attempts and requeue counters; - three successful requeues before permanent stall; - immediate visibility through `set_vt_batch(..., 0)`; - archive and permanent-stall behavior. ## Tests Added `effective_step_timeout.test.sql` with deterministic timestamps inside one transaction: - flow 60 / step 5: exactly 35 seconds stays started; 36 seconds requeues; - flow 5 / step 60: 36 seconds stays started; 91 seconds requeues; - flow 5 / null step timeout: 36 seconds requeues through flow fallback. Before the source fix, the focused test failed 5 of 10 assertions for the expected reason. The short step override returned 0 and stayed `started` at 36 seconds. The long step override requeued at 36 seconds, so its later 91-second call returned 0. After the source fix: - focused test: 1 file, 10 tests, pass; - all stalled-recovery tests: 6 files, 54 tests, pass; - full pgTAP: 285 files, 1326 tests, pass. ## Migration and release note Atlas generated `20260901203454_pgflow_temp_effective_step_timeout.sql`. It replaces `pgflow.requeue_stalled_tasks()`, includes the cumulative #645 guards, and performs no backfill. Added a separate patch changeset for `@pgflow/core`. The fixed release group expands the patch at release time. ## Checks - `pnpm nx verify-migrations core --skip-nx-cache` — pass - `pnpm nx gen-types core --skip-nx-cache` — pass; no generated type diff - `pnpm nx verify-gen-types core --skip-nx-cache` — pass - `pnpm nx test:pgtap core --skip-nx-cache` — pass; 285 files, 1326 tests - `pnpm nx test core --skip-nx-cache` — pass - `pnpm nx lint core --skip-nx-cache` — pass; 0 errors and 2 existing type-test warnings - `pnpm nx build core --skip-nx-cache` — pass - `pnpm changeset status` — pass; patch fixed group detected - `git diff --check` — pass `pnpm nx fix-sql core` hit the known Sqruff CLI mismatch: `error: unexpected argument '--force' found`. The direct repository fallback, `sqruff --config=.sqruff fix --parsing-errors pkgs/core/schemas/`, processed 37 files and found nothing to fix. Direct Sqruff lint also passed. Two fresh independent Sol xhigh review rounds returned `APPROVED` with no required findings. ## Out of scope - #656 and execution of the unreferenced `start_tasks()` visibility CTE; - #646 worker-side handler cancellation; - queue identity or per-step queue routing; - changes to #645 cancellation semantics or parent-state guards; - configurable recovery buffers or cron cadence; - migration consolidation and release PR #659. The stack still contains temporary migrations, so the main-targeted temporary-migration check can fail until the settled release sequence consolidates them. This PR does not consolidate the parent migration. Fixes #621
jumski
force-pushed
the
changeset-release/main
branch
from
September 2, 2026 05:23
b1ba4c2 to
8683d94
Compare
12 tasks
jumski
force-pushed
the
changeset-release/main
branch
2 times, most recently
from
September 4, 2026 20:51
7f0e755 to
fba164c
Compare
jumski
added a commit
that referenced
this pull request
Sep 4, 2026
…cle (#671) * ci(windows): resolve unpublished workspace deps in smoke install windows-package-smoke failed on the Version Packages branch (PR #659) with 'npm error notarget No matching version found for @pgflow/core@0.15.1': the packed CLI tarball pins @pgflow/core at the exact bumped version, which is not on npm until the release publishes. @pgflow/core pins @pgflow/dsl the same way, and @pgflow/dsl has no runtime deps, so the full closure is dsl+core+cli. Build and pack all three, and install them in one npm install command so npm resolves @pgflow/core and @pgflow/dsl from the local tarballs on both branch shapes. The #610 intent is unchanged: lifecycle scripts stay enabled and the npm-created pgflow.cmd shim still runs. * docs(website): add 0.15.1 release news article Announce the 0.15.1 task-lifecycle hardening release: terminalized tasks under skipped steps (#638), cancelled tasks on failed runs (#645), effective step timeout for stalled recovery (#621), claimed visibility before handlers run (#656), Windows install fix (#610), and the automatic historical repair shipped by the consolidated migration 20260904095427_pgflow_task_lifecycle_hardening. --------- Co-authored-by: Agent <agent@pgflow.dev>
jumski
force-pushed
the
changeset-release/main
branch
from
September 4, 2026 21:33
fba164c to
f912ccc
Compare
Contributor
🚀 Production Deployment: Website✅ Successfully deployed to production! 🔗 Production URL: https://pgflow.dev 📝 Details:
Deployed at: 2026-09-04T23:42:03+02:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
pgflow@0.15.1
Patch Changes
chmodscript that brokenpm install pgflowon Windows; npm sets the executable bit forbinfiles automatically.@pgflow/client@0.15.1
Patch Changes
@pgflow/core@0.15.1
Patch Changes
7903661: Mark unfinished tasks as cancelled when their run fails, prevent late callbacks and stalled recovery from reviving them, and repair active tasks on historical failed runs.
078aa1e: Make
start_tasks()apply the PGMQ visibility extension before it returns claimed tasks. The visibility update is now structurally required (referenced CTE instead of an unreferencedSELECTCTE PostgreSQL may skip), so a claimed task keeps the effective timeout (coalesce(step timeout, flow timeout) + 2) instead of only the initial read visibility, and a visibility-update failure rolls back the whole claim.daadcac: Terminalize queued and started task rows when their parent step is skipped: sibling tasks of a step skipped via
whenExhausted: 'skip'/'skip-cascade'(and cascade-skipped steps) now end asskippedinstead of stayingqueued/startedforever, and a migration repairs existing rows.Tasks are now terminalized before their queue messages are archived, preserving the task-before-queue lock order, and
start_tasksonly returns rows it actually claimed, so workers no longer execute tasks a concurrent skip already markedskipped.Fixes Skip paths archive sibling messages but never terminalize sibling step_tasks rows, leaving status='started' tasks on completed runs #638
35d261b: Requeue stalled tasks using the effective step timeout instead of waiting for the flow timeout.
@pgflow/edge-worker@0.15.1
Patch Changes
@pgflow/dsl@0.15.1