Skip to content

Comments

fix: optimize step skipping and improve concurrent task handling#613

Open
jumski wants to merge 1 commit into02-16-test_core_cascade_skipfrom
02-19-msg
Open

fix: optimize step skipping and improve concurrent task handling#613
jumski wants to merge 1 commit into02-16-test_core_cascade_skipfrom
02-19-msg

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Feb 19, 2026

Fix race conditions in step skipping and task failure handling

This PR addresses several race conditions and improves the robustness of the PGFlow engine:

  1. Fixes a race condition in _cascade_force_skip_steps by removing the message archiving logic that could cause conflicts with concurrent operations. This prevents errors when multiple steps are skipped simultaneously.

  2. Improves the fail_task function to properly handle concurrent task failures by acquiring locks on both run and step rows before checking status, preventing race conditions where multiple failure callbacks could read stale status.

  3. Adds a test to verify that pre-existing skipped step messages are not incorrectly archived during cascade operations.

  4. Enhances SQL formatting in the DSL compiler to properly escape apostrophes in condition patterns, preventing SQL syntax errors when condition patterns contain quotes.

  5. Updates slug validation in the DSL to allow underscores at the beginning of slugs and provides clearer error messages for invalid slugs.

These changes make the workflow engine more resilient to concurrent operations and edge cases, particularly in high-throughput scenarios where multiple steps might be processed simultaneously.

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: ef15e69

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Feb 19, 2026

View your CI Pipeline Execution ↗ for commit ef15e69

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 6m 33s View ↗
nx run client:e2e ✅ Succeeded 3m 43s View ↗
nx run core:pgtap ✅ Succeeded 2m 28s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 1m 48s View ↗
nx run cli:e2e ✅ Succeeded 8s View ↗
nx run edge-worker:e2e ✅ Succeeded 55s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-19 17:39:24 UTC

@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-613.pgflow.pages.dev

📝 Details:

  • Branch: 02-19-msg
  • Commit: cc0d1338af82ad0acda7f80dfbbbe93302c467a6
  • View Logs

_Last updated: _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant