fix: optimize step skipping and improve concurrent task handling#613
fix: optimize step skipping and improve concurrent task handling#613jumski wants to merge 1 commit into02-16-test_core_cascade_skipfrom
Conversation
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit ef15e69
☁️ Nx Cloud last updated this comment at |
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-613.pgflow.pages.dev 📝 Details:
_Last updated: _ |

Fix race conditions in step skipping and task failure handling
This PR addresses several race conditions and improves the robustness of the PGFlow engine:
Fixes a race condition in
_cascade_force_skip_stepsby removing the message archiving logic that could cause conflicts with concurrent operations. This prevents errors when multiple steps are skipped simultaneously.Improves the
fail_taskfunction 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.Adds a test to verify that pre-existing skipped step messages are not incorrectly archived during cascade operations.
Enhances SQL formatting in the DSL compiler to properly escape apostrophes in condition patterns, preventing SQL syntax errors when condition patterns contain quotes.
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.