Title: improvement(deployments): shorten lock windows and add tx safety timeouts on the deploy path by waleedlatif1 · Pull Request #5841 · simstudioai/sim · GitHub
Open Graph Title: improvement(deployments): shorten lock windows and add tx safety timeouts on the deploy path by waleedlatif1 · Pull Request #5841 · simstudioai/sim
X Title: improvement(deployments): shorten lock windows and add tx safety timeouts on the deploy path by waleedlatif1 · Pull Request #5841 · simstudioai/sim
Description: Summary checkpointWebhookCandidate is now a single fenced UPDATE (no transaction, no workflow-row lock) — it runs after every external provider call, so it no longer holds webhook locks across client round trips; operation currency is asserted in-statement via exists/notExists Merged the retire + repoint webhook UPDATEs at activation into one generation-conditional statement (candidate promotion stays separate — non-deferrable partial unique index webhook_active_registration_unique forbids vacate+claim in one statement) Collapsed the deactivate-all + activate-one workflow_deployment_version pair into one UPDATE that only touches rows whose is_active actually changes (stops rewriting every version row on every deploy) Dropped no-op transaction wrappers and an ineffective FOR UPDATE from the webhook cleanup snapshot/delete helpers New setDeploymentTxTimeouts (statement 30s / lock 5s / idle-in-tx 30s via set_config(..., true), PgBouncer-safe, one round trip) applied to all 8 deployment-path transactions so a wedged client can never pin webhook/workflow locks indefinitely Bounded retention prune for terminal workflow_deployment_operation rows (>30d) in the stale-executions cron; the newest-generation row per workflow is structurally excluded so generation numbering stays monotonic Context Follow-up to the PlanetScale lock-spike alert: idle-in-transaction sessions holding RowExclusiveLocks on webhook + its indexes during concurrent deploys. Root cause was multi-statement transactions idling between round trips, not traffic. Type of Change Improvement Testing All 7 affected suites pass (95 tests); SQL rendering verified against drizzle 0.45.2 via toSQL(); semantics of merged statements audited for bit-identical column values vs the old statement pairs Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary checkpointWebhookCandidate is now a single fenced UPDATE (no transaction, no workflow-row lock) — it runs after every external provider call, so it no longer holds webhook locks across cli...
X Description: Summary checkpointWebhookCandidate is now a single fenced UPDATE (no transaction, no workflow-row lock) — it runs after every external provider call, so it no longer holds webhook locks across cli...
Opengraph URL: https://github.com/simstudioai/sim/pull/5841
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e378fa1d-33ae-e238-30a9-cff5af439f34 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BE78:1D90B4:407174:5A5F46:6A6309D6 |
| html-safe-nonce | b133f73ff7605421c925aebbf344ca8bcb1f9446cb12aa4566feec2e0765804d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTc4OjFEOTBCNDo0MDcxNzQ6NUE1RjQ2OjZBNjMwOUQ2IiwidmlzaXRvcl9pZCI6IjQ1NTcxNDk0Mjc0MzA3ODc1NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6bf4e8912930b76468d6894adf47da14a3f3e4a06b84d58dd8e8446b26242431 |
| hovercard-subject-tag | pull_request:4105676257 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5841/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary checkpointWebhookCandidate is now a single fenced UPDATE (no transaction, no workflow-row lock) — it runs after every external provider call, so it no longer holds webhook locks across cli... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b48e7bf0b1945d51f303503b057abf666ce74c3efbe107b413db2bb921c3f012 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9370f37042c29822d6ba7e3f670f0036a0155b21 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width