René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e378fa1d-33ae-e238-30a9-cff5af439f34
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE78:1D90B4:407174:5A5F46:6A6309D6
html-safe-nonceb133f73ff7605421c925aebbf344ca8bcb1f9446cb12aa4566feec2e0765804d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTc4OjFEOTBCNDo0MDcxNzQ6NUE1RjQ2OjZBNjMwOUQ2IiwidmlzaXRvcl9pZCI6IjQ1NTcxNDk0Mjc0MzA3ODc1NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6bf4e8912930b76468d6894adf47da14a3f3e4a06b84d58dd8e8446b26242431
hovercard-subject-tagpull_request:4105676257
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5841/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb48e7bf0b1945d51f303503b057abf666ce74c3efbe107b413db2bb921c3f012
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9370f37042c29822d6ba7e3f670f0036a0155b21
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5841/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5841%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5841%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5841/files
Reloadhttps://github.com/simstudioai/sim/pull/5841/files
Reloadhttps://github.com/simstudioai/sim/pull/5841/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
simstudioai https://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Notifications https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Fork 3.7k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Star 29.2k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Code https://github.com/simstudioai/sim
Issues 111 https://github.com/simstudioai/sim/issues
Pull requests 120 https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality 0 https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Code https://github.com/simstudioai/sim
Issues https://github.com/simstudioai/sim/issues
Pull requests https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
improvement/deploy-lock-friendlinesshttps://github.com/simstudioai/sim/tree/improvement/deploy-lock-friendliness
Conversation 8 https://github.com/simstudioai/sim/pull/5841
Commits 1 https://github.com/simstudioai/sim/pull/5841/commits
Checks 19 https://github.com/simstudioai/sim/pull/5841/checks
Files changed https://github.com/simstudioai/sim/pull/5841/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
improvement(deployments): shorten lock windows and add tx safety timeouts on the deploy path https://github.com/simstudioai/sim/pull/5841/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/5841/files
c9e9909 improvement(deployments): shorten lock windows and add tx safety time… waleedlatif1 Jul 22, 2026 https://github.com/simstudioai/sim/pull/5841/commits/c9e990924c77c2d1985c096ed706e701d9e39c63
Clear filters https://github.com/simstudioai/sim/pull/5841/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
route.ts https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
registration-store.test.ts https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
registration-store.ts https://github.com/simstudioai/sim/pull/5841/files#diff-8c8cdd77aebaa1668306b972730f8669fff1985b2ca55c3582733ac3b2ce64cb
deployment-outbox.test.ts https://github.com/simstudioai/sim/pull/5841/files#diff-12eb6ae4ffd51f0f060ad9327b44c4f22d258c485a211fdf1b8b31bba354bf29
deployment-outbox.ts https://github.com/simstudioai/sim/pull/5841/files#diff-31b0b82ca5e72feea1bbcac6b4c21a2e4f9551a96dd0d52d8a178be5177e7164
deployment-operations.test.ts https://github.com/simstudioai/sim/pull/5841/files#diff-56b1ec6f976dafdbe48823022ad5c450ec75e95a00ec6747dd65d447f9dcb773
deployment-operations.ts https://github.com/simstudioai/sim/pull/5841/files#diff-6a79f1da6a0ba17c1d1ec8682816d8b7e900ca6cff24624d3bb6f35b339c34a0
apps/sim/app/api/cron/cleanup-stale-executions/route.tshttps://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
View file https://github.com/simstudioai/sim/blob/c9e990924c77c2d1985c096ed706e701d9e39c63/apps/sim/app/api/cron/cleanup-stale-executions/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5841/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
https://github.com/simstudioai/sim/pull/5841/files#diff-3c5077959e4545be2034b5b99e76849a74f2d3bd0e41e546514214def8fe3563
apps/sim/lib/webhooks/registration-store.test.tshttps://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
View file https://github.com/simstudioai/sim/blob/c9e990924c77c2d1985c096ed706e701d9e39c63/apps/sim/lib/webhooks/registration-store.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5841/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
https://github.com/simstudioai/sim/pull/5841/files#diff-e0f4ccfd538d106122ac48919442435d06d603d78611360f62c205da6f7922d6
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5841/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.