René's URL Explorer Experiment


Title: fix(run-engine): debounce hot-key lock contention and 5xx feedback loop by ericallam · Pull Request #3453 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(run-engine): debounce hot-key lock contention and 5xx feedback loop by ericallam · Pull Request #3453 · triggerdotdev/trigger.dev

X Title: fix(run-engine): debounce hot-key lock contention and 5xx feedback loop by ericallam · Pull Request #3453 · triggerdotdev/trigger.dev

Description: Changes Three changes in internal-packages/run-engine/src/engine/systems/debounceSystem.ts, in order of impact: Fast-path skip before the lock. In handleExistingRun, do an unlocked read of delayUntil (and createdAt for the max-duration check) from the run row before entering runLock.lock("handleDebounce", ...). If newDelayUntil <= currentDelayUntil and the run is still within its max-duration window, return the existing run immediately without taking the lock. Safe because debounce is monotonic-forward only — a stale read either matches reality or undershoots, both of which decay correctly (re-checked properly inside the lock by whichever caller is actually pushing forward). Trailing-mode triggers carrying updateData still take the lock so the data update is applied. Quantize newDelayUntil. Round the computed newDelayUntil to 1-second buckets (configurable via quantizeNewDelayUntilMs, set to 0 to disable). Without quantization, every call has a slightly larger newDelayUntil than the last and they all pass the fast-path check. With it, concurrent callers on the same key share a target time and ~95% short-circuit. User-visible effect: a debounced run might fire up to 1s earlier than the strict spec — non-issue for typical debounce use cases (chat summarization, batched notifications, etc.). Graceful lock-contention fallback. Wrap the runLock.lock(...) call so LockAcquisitionTimeoutError and Redlock ExecutionError / ResourceLockedError return the existing run id with success instead of propagating a 5xx. Debounce is best-effort: if we can't take the lock, the herd is already updating it for us; fall in line. This kills the 5xx → SDK-retry feedback loop. With (1)+(2) this rarely fires; without them it's the difference between 5xx and 200. Defaults preserve current behaviour aside from quantization (1s) and fast-path (on). Both are configurable via RunEngineOptions.debounce. ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Changelog Reduce 5xx feedback loops on hot debounce keys by quantizing delayUntil, adding an unlocked fast-path skip before the redlock, and gracefully handling redlock contention in handleDebounce so the SDK no longer retries into a herd.

Open Graph Description: Changes Three changes in internal-packages/run-engine/src/engine/systems/debounceSystem.ts, in order of impact: Fast-path skip before the lock. In handleExistingRun, do an unlocked read of delayU...

X Description: Changes Three changes in internal-packages/run-engine/src/engine/systems/debounceSystem.ts, in order of impact: Fast-path skip before the lock. In handleExistingRun, do an unlocked read of delayU...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/3453

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e1604444-e794-bacc-6067-b2043bc601de
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA2A0:3C1EA1:35EE3B2:49521DA:6AFAEDAA
html-safe-nonce7ba345985a796702b524e1764f58eacf15b954d3ef91ca0700e5ae982f8c1cbd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkEwOjNDMUVBMTozNUVFM0IyOjQ5NTIxREE6NkFGQUVEQUEiLCJ2aXNpdG9yX2lkIjoiMTcwMTUyODkyMzM0NDEzNzY0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6e3aec631a6879de1f39e4576f4440cfd02e6d7f28c5c8af409471ee4c662606
hovercard-subject-tagpull_request:3590099521
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/triggerdotdev/trigger.dev/pull/3453/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altChanges Three changes in internal-packages/run-engine/src/engine/systems/debounceSystem.ts, in order of impact: Fast-path skip before the lock. In handleExistingRun, do an unlocked read of delayU...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
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
release12fff95459b24b0f882a66698ee6a36a5934d247
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3453/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3453%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3453%2Ffiles
Sign uphttps://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=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
devin/1777296659-debounce-fast-pathhttps://github.com/triggerdotdev/trigger.dev/tree/devin/1777296659-debounce-fast-path
Conversation 41 https://github.com/triggerdotdev/trigger.dev/pull/3453
Commits 9 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits
Checks 46 https://github.com/triggerdotdev/trigger.dev/pull/3453/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3453/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
fix(run-engine): debounce hot-key lock contention and 5xx feedback loop https://github.com/triggerdotdev/trigger.dev/pull/3453/files#top
Show all changes 9 commits https://github.com/triggerdotdev/trigger.dev/pull/3453/files
bbf5dd9 fix(run-engine): debounce hot-key lock contention and 5xx feedback loop devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/bbf5dd98f1176fc05d75177eb4a55cfc1a917c88
293de56 test: align lock contention test prefix with engine, assert delayUnti… devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/293de56fe5ae31844b5536a6c07df9463d989994
5b1e357 fix: surface lock contention for trailing-mode updateData devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/5b1e357d7ab5e460ed1330050a601b381e33a192
30586b4 test(run-engine): add hot-key debounce stress tests + replica-routed … devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/30586b45f4f78cd0e242c55e16e24715cfe22d33
5fc14ff fix(run-engine): always validate fast-path skip on the writer devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/5fc14ffdf0757017fe0dbbf9592fa292bb2fa238
5cca5f2 fix(run-engine): route both fast-path reads through replica when enabled devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/5cca5f2f163ed3213fc3568e2a1bcfab0edb809b
659efbf feat(webapp): expose debounce fast-path/quantization knobs as env vars devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/659efbf455bf642aad81d2a1d973b08d3070f14b
3bd4b37 test(run-engine): replace prisma.taskRun.update spy with runDelayResc… devin-ai-integration[bot] Apr 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/3bd4b37372fe159279369cd97103f95a6ca6e7f3
1ca4719 fix(run-engine): drop trailing+updateData rethrow on lock contention ericallam Apr 28, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3453/commits/1ca4719aa990554852d84502f291ad3d285c1ead
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3453/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
debounce-hot-key-lock-contention.md https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-7a088b8c00ad793f1ed0f52495c2bb0020160d2a880a5ebc5102ecada6746fd4
env.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
runEngine.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
index.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
debounceSystem.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-489c9481b7d581455ef902eef1231e30f41cca49a714940778f0d83ee2b4fcd8
debounce.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-d4c49a50702c1b8c228352886b6099c172ec6bab949bbe4d96d3c6283723298b
types.ts https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-81c21d7967ac61777b1a20d53a0f821068d182af9f44ec4bd64b967c8fbd6d92
.server-changes/debounce-hot-key-lock-contention.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-7a088b8c00ad793f1ed0f52495c2bb0020160d2a880a5ebc5102ecada6746fd4
View file https://github.com/triggerdotdev/trigger.dev/blob/1ca4719aa990554852d84502f291ad3d285c1ead/.server-changes/debounce-hot-key-lock-contention.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3453/{{ revealButtonHref }}
apps/webapp/app/env.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
View file https://github.com/triggerdotdev/trigger.dev/blob/1ca4719aa990554852d84502f291ad3d285c1ead/apps/webapp/app/env.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3453/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
apps/webapp/app/v3/runEngine.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
View file https://github.com/triggerdotdev/trigger.dev/blob/1ca4719aa990554852d84502f291ad3d285c1ead/apps/webapp/app/v3/runEngine.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3453/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
internal-packages/run-engine/src/engine/index.tshttps://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
View file https://github.com/triggerdotdev/trigger.dev/blob/1ca4719aa990554852d84502f291ad3d285c1ead/internal-packages/run-engine/src/engine/index.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3453/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
https://github.com/triggerdotdev/trigger.dev/pull/3453/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3453/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.