mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
A Coach snapshot, a derived-metric batch or the Insights page fans out into a dozen readers that each probe the same account's rollup coverage at once. In production one MCP get_metrics call held 59 of these probes open on the database together, each taking about 320 ms under that contention, and the same burst repeated every 15 minutes. Concurrent probes for one account now join the query already running. Nothing is kept after it settles, each caller gets its own map, and a measurement write drops the in-flight entry so a probe that starts after a write always reads afresh. The registry lives on globalThis so every server bundle shares it.