René's URL Explorer Experiment


Title: fix(run-engine): stop requeued runs with a lapsed ttl being orphaned in the queue by matt-aitken · Pull Request #4669 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(run-engine): stop requeued runs with a lapsed ttl being orphaned in the queue by matt-aitken · Pull Request #4669 · triggerdotdev/trigger.dev

X Title: fix(run-engine): stop requeued runs with a lapsed ttl being orphaned in the queue by matt-aitken · Pull Request #4669 · triggerdotdev/trigger.dev

Description: Summary A run triggered with a ttl could get permanently stuck showing as queued. If the run started executing and was then requeued after a failure (a stalled heartbeat, a worker dying mid-run) once its TTL had already elapsed, the next dequeue pass silently dropped it from every queue structure. The run stayed QUEUED in the database forever, and nothing (dequeue, the TTL consumer, queue repair) could ever see it again. Root cause Enqueue registers a TTL entry for the TTL consumer, and the first dequeue removes it ("the run is executing, not expired"). A nack rewrote the message preserving the original ttlExpiresAt without re-registering that entry. The next dequeue pass then took the expired-TTL branch: remove the run from the queue sorted sets and leave the message for the TTL consumer to finalize. But the consumer's entry was gone, so nothing ever finalized the run. The fix has two halves: nackMessage drops ttlExpiresAt from the rewritten message. TTL only applies to runs that have never been dequeued (the same contract as includeTtl on re-enqueues), so a requeued run stays dequeuable and is never expired by its original deadline. The dequeue expired-TTL branches now (re-)register the TTL entry instead of assuming it exists, so any message still carrying a lapsed ttlExpiresAt with no TTL entry (including ones written before this fix) finalizes as EXPIRED instead of orphaning. Verification New engine test suite ttlNackRequeue.test.ts (testcontainers, real Redis and Postgres). All four tests fail before the fix and pass after: a heartbeat-stalled EXECUTING run with a lapsed TTL is requeued and dequeued again instead of orphaned (the full production failure chain) requeue-after-failure strips ttlExpiresAt so later dequeues do not treat the run as expired a lapsed-TTL message whose TTL entry is missing is re-registered by dequeue and finalized as EXPIRED, for both plain and concurrency-key queues Also ran the existing ttl, heartbeats, dequeuing and attemptFailures engine suites plus the full run-queue suite (149 tests) against the change.

Open Graph Description: Summary A run triggered with a ttl could get permanently stuck showing as queued. If the run started executing and was then requeued after a failure (a stalled heartbeat, a worker dying mid-run) on...

X Description: Summary A run triggered with a ttl could get permanently stuck showing as queued. If the run started executing and was then requeued after a failure (a stalled heartbeat, a worker dying mid-run) on...

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

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:fce25613-c110-6801-75bf-0bc762118932
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8C80:3F7AD1:BC9A0A:10EEF80:6AFAF2CE
html-safe-nonce9ee5381c01afe5c8910e3a2b978f03a4fb6d821356346ef4c0c903bbfa663423
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzgwOjNGN0FEMTpCQzlBMEE6MTBFRUY4MDo2QUZBRjJDRSIsInZpc2l0b3JfaWQiOiIxODc5NDYxMDAwMjgxNTE4Nzk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbe7f7ea0d51446a7d8ea0d7a911e098be8a9e2584fd2ade532a0045d9cb0d608
hovercard-subject-tagpull_request:4306655405
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/4669/files
twitter:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
og:image:altSummary A run triggered with a ttl could get permanently stuck showing as queued. If the run started executing and was then requeued after a failure (a stalled heartbeat, a worker dying mid-run) on...
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
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4669/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4669%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%2F4669%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/4669/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4669/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4669/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
matt-aitkenhttps://github.com/matt-aitken
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
fix/runqueue-ttl-nack-orphanhttps://github.com/triggerdotdev/trigger.dev/tree/fix/runqueue-ttl-nack-orphan
Conversation 4 https://github.com/triggerdotdev/trigger.dev/pull/4669
Commits 1 https://github.com/triggerdotdev/trigger.dev/pull/4669/commits
Checks 49 https://github.com/triggerdotdev/trigger.dev/pull/4669/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4669/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4669/files
fix(run-engine): stop requeued runs with a lapsed ttl being orphaned in the queue https://github.com/triggerdotdev/trigger.dev/pull/4669/files#top
Show all changes 1 commit https://github.com/triggerdotdev/trigger.dev/pull/4669/files
5cf73cd fix(run-engine): stop requeued runs with a lapsed ttl being orphaned … matt-aitken Aug 18, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4669/commits/5cf73cdc7d3bfcde87b73d236cfc2718caaaaf97
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4669/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4669/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4669/files
ttl-runs-no-longer-stuck-after-requeue.md https://github.com/triggerdotdev/trigger.dev/pull/4669/files#diff-184242beff6994e42e462ca50d1bb41ee10b03e771ea59ce96c9c5fc6fd2291c
ttlNackRequeue.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4669/files#diff-fa1fcf5579800222ad28024200b6dff6595cdc2a31e74cefb17d33a5a1344c1e
index.ts https://github.com/triggerdotdev/trigger.dev/pull/4669/files#diff-0365b31224e46e323c8868fee705d14146349e29abd175070c7e7a49e9cb73ae
.server-changes/ttl-runs-no-longer-stuck-after-requeue.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4669/files#diff-184242beff6994e42e462ca50d1bb41ee10b03e771ea59ce96c9c5fc6fd2291c
View file https://github.com/triggerdotdev/trigger.dev/blob/5cf73cdc7d3bfcde87b73d236cfc2718caaaaf97/.server-changes/ttl-runs-no-longer-stuck-after-requeue.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4669/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4669/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.