Coalesce concurrent identical fact queries #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Fact responses are no longer cached. Dropping the fact paths from
cacheForalso bypassess.flights.DoinserveFiltered(the!enabledbranch callsbuild()directly), so single-flight coalescing was lost along with the cache.Concurrent identical fact queries now each trigger a full two-backend, whole-estate fan-out. Puppetboard's facts overview page (
views/facts.py, routes/factsand/<env>/facts) issues a query filtered only by environment, andquery=Nonewhen "All Environments" is selected. Measured through pdbmux: ~3.4-3.8s and 14.7MB per request. Two simultaneous page loads cost two full fan-outs instead of one.Proposal
Restore single-flight coalescing for the fact paths, independent of the response cache.
Coalescing merges requests that are identical and concurrently in flight. It stores nothing and serves nothing after completion, so it introduces no staleness and keeps fact caching out of the proxy. It is thundering-herd protection only.
Acceptance
X-CacheorAgeheaders on any fact response./pdb/query/v4/facts,/facts/<name>and/fact-names.