-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add advisory locks to prevent concurrent flow compilation race conditions #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12-01-remove_unused_ensure-compiled_http_endpoint_from_controlplane
Are you sure you want to change the base?
Conversation
|
|
View your CI Pipeline Execution ↗ for commit bcc4f76
☁️ Nx Cloud last updated this comment at |
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-477.pgflow.pages.dev 📝 Details:
_Last updated: _ |
810954f to
bcc4f76
Compare
8875a41 to
58d1ef1
Compare

Add Advisory Locks to Prevent Concurrent Flow Compilation Race Conditions
This PR adds transaction-level advisory locks to the
ensure_flow_compiledfunction to prevent race conditions during concurrent flow compilation attempts. The implementation:hashtext()pg_advisory_xact_lock(1, v_lock_key)A comprehensive stress test was added that verifies the locking behavior by:
This change prevents potential data corruption or duplicate entries that could occur when multiple workers attempt to compile the same flow simultaneously.