{"threadId":"thr_5tpdgiiyp4","totalDurationMs":189.2,"thresholdMs":150,"selectionStrategy":"full","pageKind":"latest","eventRowCount":1320,"eventDataBytes":688143,"projectedRowCount":261,"responseRowCount":261,"msg":"Thread timeline build blocked the event loop"}
{"threadId":"thr_tddwe6esxx","totalDurationMs":224.4,"thresholdMs":150,"selectionStrategy":"standard-window","pageKind":"latest","eventRowCount":1130,"eventDataBytes":703094,"projectedRowCount":298,"responseRowCount":298,"msg":"Thread timeline build blocked the event loop"}
With 2 running threads the bb server used 24% of a core, with 10 running threads 84% (CPU-time deltas from
Summary
The server's thread-timeline response cache skips any response with more than 200 top-level rows. Once a requested page of a long thread passes that size, two requests with an identical cache key (same revision and same request parameters — for example a second desktop window, or a plugin calling
threads.timelinewith the app's parameters) each run their own full projection instead of sharing one. I expected identical requests to share one build regardless of response size.Versions and environment
Steps to reproduce
repro-cache.tsin the checkout root:node --experimental-strip-types repro-cache.tsfrom the checkout root.Expected vs actual
Evidence
bb/apps/server/src/services/threads/timeline-cache.ts
Line 46 in c1a64f4
#L6(DEFAULT_MAX_CACHEABLE_ROWS = 200).maxSeqplus thread, status, environment, provider display name, page (kind, segment limit, cursor), nested rows, summary-only, diagnostic operations and completed-turn display:bb/apps/server/src/services/threads/timeline-cache.ts
Lines 90 to 110 in c1a64f4
pageKind: "latest". From~/.bb/logs/server.8.log, trimmed:ps -o cputimeover fixed 40 s windows). I did not measure how many of those builds were identical-key misses, so I am not claiming this cutoff explains that load — only that above 200 rows the cache cannot help at all.thr_tddwe6esxxon my machine (local, not shareable by link); I can paste the measurement notes and scripts here on request.What you ruled out
maxSeqis a new key, so one build per revision is inherent. One slow build in the same log hadresponseRowCount137, under the cutoff.bb browser instances), no leaked browser views.Suggested priority and effort
Affects long threads viewed by more than one client with identical request parameters. No workaround, no data loss. Replacing the row cutoff needs a memory-policy decision (rows can carry large nested content), so I am not suggesting an effort level.