René's URL Explorer Experiment


Title: fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch · Issue #2902 · developing-today/code · GitHub

Open Graph Title: fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch · Issue #2902 · developing-today/code

X Title: fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch · Issue #2902 · developing-today/code

Description: Finding QueueClient.ensureWorker() in pm-dispatch memoizes its registration promise with ??= — including when that promise rejects. One transient registration failure (a PostgREST 5xx, a network blip) therefore wedges every subsequent la...

Open Graph Description: Finding QueueClient.ensureWorker() in pm-dispatch memoizes its registration promise with ??= — including when that promise rejects. One transient registration failure (a PostgREST 5xx, a network bl...

X Description: Finding QueueClient.ensureWorker() in pm-dispatch memoizes its registration promise with ??= — including when that promise rejects. One transient registration failure (a PostgREST 5xx, a network bl...

Opengraph URL: https://github.com/developing-today/code/issues/2902

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch","articleBody":"## Finding\n\n`QueueClient.ensureWorker()` in pm-dispatch memoizes its registration promise with `??=` — including when that promise **rejects**. One transient registration failure (a PostgREST 5xx, a network blip) therefore wedges every subsequent launch for the life of the process: each later `ensureWorker()` returns the same rejected promise and throws the original, stale error.\n\n## Evidence\n\n- PR #2655 (commit `88e2e699e1`, MERGED) introduced `ensureWorker()`.\n- Verified on current main (`c4fb599617166d4c705eabeb34442ca179ecb9a6`), `pm-stack/dispatch/src/queue.ts:132,137-158`:\n\n  ```ts\n  private workerEnsured: Promise\u003cvoid> | null = null;\n\n  ensureWorker(): Promise\u003cvoid> {\n    this.workerEnsured ??= (async () => {\n      const res = await fetch(`${this.baseUrl}/rest/v1/workers`, { … });\n      if (!res.ok) {\n        const text = await res.text();\n        throw new QueueError(`worker registration failed (HTTP ${res.status}): …`, res.status);\n      }\n    })();\n    return this.workerEnsured;\n  }\n  ```\n\n  There is no `.catch` that resets `workerEnsured` to `null`, and no other code path clears it.\n- Caller order makes it worse: `launchSession` (`src/server.ts:116-129`) creates the OpenCode session and sends the prompt **before** `ensureWorker()` runs. So every launch after the first failure creates a real, running session, then throws at registration — and on the `wait:true` path the task is cancelled and the launch reported FAILED while that session keeps working, untracked.\n\n## Why it matters\n\nRegistration is a one-time, idempotent upsert whose failure modes are overwhelmingly transient — this exact class of failure is what the fleet hit repeatedly on 2026-10-30 (PostgREST 503s during the Supabase outage). A retry-on-next-launch costs nothing; a permanently poisoned cache turns a blip into a dispatch outage that only a service restart fixes, plus a trail of untracked sessions.\n\n## Acceptance criteria\n\n- [ ] A rejected registration attempt is not cached: `workerEnsured` is reset on rejection so the next `ensureWorker()` call retries the upsert (a *successful* registration stays cached).\n- [ ] A unit test covers: first attempt fails (non-OK response or fetch throw), second attempt succeeds, and subsequent calls reuse the success without re-fetching.\n- [ ] No other behaviour of `ensureWorker()` changes (same worker row, same ignore-duplicates upsert).\n\nFound by the pr-diff-review job reviewing PR #2655 (batch 2630–2658, 2026-10-30). Deduped: `gh issue list --search 'ensureWorker worker registration dispatch'` and `'workerEnsured'` (open + all) returned nothing covering this.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-31T01:39:09Z","url":"https://github.com/developing-today/code/issues/2902"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2923d99a-be1e-5f66-f02e-5402a6b9afaa
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id80B4:29E85A:2858E5:34E83B:6B062D9F
html-safe-noncef200b88225b6c2522c67f30d06a0f494bee7dcaba421dcb096b429eca9119d11
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEI0OjI5RTg1QToyODU4RTU6MzRFODNCOjZCMDYyRDlGIiwidmlzaXRvcl9pZCI6Ijc3NzcyNjQ5NTAwMjM0MDc2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac62c0f454a696b5631a4fa63f68b229d2eef0ff22ef76da735cd0b4f1031845f9
hovercard-subject-tagissue:6129711121
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2902/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b282d4a3fe440925ed6ab6db824f7dfadd253999c1b88e86a7fd224e05ab4b79/developing-today/code/issues/2902
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b282d4a3fe440925ed6ab6db824f7dfadd253999c1b88e86a7fd224e05ab4b79/developing-today/code/issues/2902
og:image:altFinding QueueClient.ensureWorker() in pm-dispatch memoizes its registration promise with ??= — including when that promise rejects. One transient registration failure (a PostgREST 5xx, a network bl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
None7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release494ea0bb1e0feef734a83e2628697647755e8864
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/2902#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F2902
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%2Fdeveloping-today%2Fcode%2Fissues%2F2902
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/2902
Reloadhttps://github.com/developing-today/code/issues/2902
Reloadhttps://github.com/developing-today/code/issues/2902
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests151 (151)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/2902
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/2902
#2908https://github.com/developing-today/code/pull/2908
fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launchhttps://github.com/developing-today/code/issues/2902#top
#2908https://github.com/developing-today/code/pull/2908
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/highhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fhigh%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issue-6129711121
fix(pm-dispatch): register the dispatch-opencode worker row before claiming #2655https://github.com/developing-today/code/pull/2655
#2655https://github.com/developing-today/code/pull/2655
dezren39https://github.com/dezren39
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
priority/highhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fhigh%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34746707829
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537306806
ci: main-only workflow triggers, cancel-in-progress everywhere #2630https://github.com/developing-today/code/pull/2630
feat(pm-dispatch): record the lane assignment after a launch claim #2658https://github.com/developing-today/code/pull/2658
fix(pm-dispatch): register the dispatch-opencode worker row before claiming #2655https://github.com/developing-today/code/pull/2655
fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch #2902https://github.com/developing-today/code/issues/2902
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537337615
dezren39https://github.com/dezren39
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
status/needs-triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22
queue/queuedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34746878502
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537339004
fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch #2902https://github.com/developing-today/code/issues/2902
2a66b4dhttps://github.com/developing-today/code/commit/2a66b4d41d2883d17aa3fdce4f29e1ada34ebef7
feat(id): note.link events and the head-based backlink projection (#3816) #4131https://github.com/developing-today/code/pull/4131
dezren39https://github.com/dezren39
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34746885598
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537358088
fix(pm-dispatch): ensureWorker caches a rejected promise forever — one transient failure wedges every later launch #2902https://github.com/developing-today/code/issues/2902
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537382552
pm-dispatch(queue): ensureWorker caches its first failure forever — one transient Supabase 500 permanently wedges every session launch until restart #2663https://github.com/developing-today/code/issues/2663
pm-dispatch(queue): ensureWorker caches its first failure forever — one transient Supabase 500 permanently wedges every session launch until restart #2663https://github.com/developing-today/code/issues/2663
design(pm-dispatch): launch pipeline, staged — validate the whole request at the boundary, one commit point, nothing after it can fail the launch #2668https://github.com/developing-today/code/issues/2668
pm-dispatch(queue): ensureWorker caches its first failure forever — one transient Supabase 500 permanently wedges every session launch until restart #2663https://github.com/developing-today/code/issues/2663
#2663https://github.com/developing-today/code/issues/2663
#2663https://github.com/developing-today/code/issues/2663
#2663https://github.com/developing-today/code/issues/2663
dezren39https://github.com/dezren39
not plannedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34747037837
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34747307341
Merge pull request #2908 from developing-today/queue/4131-2902-ensure…https://github.com/developing-today/code/commit/f0a7b0a46dd3ea52150d11541dbbd5dd7aec4fea
#2908https://github.com/developing-today/code/pull/2908
f0a7b0ahttps://github.com/developing-today/code/commit/f0a7b0a46dd3ea52150d11541dbbd5dd7aec4fea
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#issuecomment-6537465547
fix(pm-dispatch): reset ensureWorker memo on rejection (#2902) #2908https://github.com/developing-today/code/pull/2908
f0a7b0ahttps://github.com/developing-today/code/commit/f0a7b0a46dd3ea52150d11541dbbd5dd7aec4fea
fix(ci): wire daily-dispatch workflow_dispatch inputs into prompts (#2681) #2893https://github.com/developing-today/code/pull/2893
fix(pm-dispatch): reset ensureWorker memo on rejection (#2902) #2908https://github.com/developing-today/code/pull/2908
dezren39https://github.com/dezren39
status/in-progresshttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22
queue/claimedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22
work/assignedhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22
on Oct 31, 2026https://github.com/developing-today/code/issues/2902#event-34747332615
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/2902
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/2902
app/pm-stackhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fpm-stack%22
effort/shttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22effort%2Fs%22
kind/bughttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/highhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fhigh%22
source/pr-diff-reviewhttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fpr-diff-review%22
task/triagehttps://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.