arr-meta response cache is unbounded and in memory #158
Closed
opened 2026-08-24 07:45:51 +01:00 by naps62-yolo
·
1 comment
No Branch/Tag Specified
main
ui-mobile-first
codex/fix-action-button-reload
translation
qbit-2
docker
bugs
blitz/subtitles
fix/255-provider-reorder
blitz/feedback-3
subtitles/251-icon-vocab
subtitles/237-relocate-subs
fix/248-title-move-creates-root
blitz/feedback-2
issue/227-abandoned-pack-visible
issue/245-backoff-anchor
issue/240-design-coherence
issue/211-waived-rule
issue/232-plainer-words
issue/246-policy-reclassify
issue/244-root-slash-stored
issue/231-settings-rows
issue/241-reclassify-on-root-change
issue/239-failure-window
issue/230-icon-only
issue/243-root-path-edges
issue/238-attention-liveness
issue/229-back-button
issue/236-root-path-move
issue/226-attention-threshold
issue/228-root-move
blitz/size-bands
size-bands/209-runtime-scale
size-bands/210-size-waiver
size-bands/208-runtime-design
blitz/reliability
reliability/155-sqlx-migrations
reliability/176-refresh-on-add
removal-nav/175-removal-controls
removal-nav/174-season-file-removal
removal-nav/172-search-titles
removal-nav/173-homepage-library
removal-nav/171-untrack-clears
removal-nav/170-chip-align
removal-nav/169-design-amendment
feedback/167-deck-autosearch
feedback/165-chip-colour
feedback/166-header-rail
feedback/163-drop-cast
feedback/164-control-geometry
feedback/162-season-ordering
feedback/161-search-episodes
feedback/160-autotrack-seed
feedback/159-design-amend
blitz/rich-metadata
rich/151-grid
rich/148-search-rows
rich/150-series-meta
rich/149-movie-page
rich/147-search-art
rich/156-rating-null
rich/146-meta-api
rich/145-poster-cols
rich/144-trailer
rich/143-meta-detail
rich/142-design-amend
blitz/153-empty-episode-titles
blitz/152-deck-routes
blitz/141-season-vanished-api
blitz/129-series-detail-view
blitz/140-attention-episode-numbers
blitz/137-season-removals
blitz/133-attention-tv-lanes
blitz/139-movie-id-episode-guard
blitz/134-stale-attention-queue
blitz/124-rss-episode-matching
blitz/136-imdb-series-lookup
blitz/132-manual-commands
blitz/128-series-delete-files
blitz/131-status-seasons-input
blitz/138-plural-season-range
blitz/135-pack-name-parse
blitz/122-upstream-removals
blitz/130-add-series-search
blitz/121-series-refresh
blitz/127-unified-search-tv
blitz/123-episode-matching
blitz/126-tv-attention
blitz/119-tracked-rule
blitz/125-season-deck
blitz/120-tvdb-id
blitz/118-season-zero
blitz/117-design-amend
issue/115-avail-search
issue/112-name-truncate
issue/111-score-colors
No results found.
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
Milestone
No items
No Milestone
Reliability and first run
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#158
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
arr-meta's response cache holds every TMDB body in memory as anArc<str>,and only ever drops an entry when someone reads a stale one or calls
clear().A body nobody asks for again is never evicted. There is no size bound.
Operator decision: this should be a filesystem cache, not an in-memory one.
The rich metadata milestone made the cost visible. Before it, the cache held
search pages and the reduced movie/series records. It now also holds full
append_to_response=credits,videos,external_idspayloads — several timeslarger — one per title anyone opens. Footprint therefore scales with how many
titles get looked at in a day, with no ceiling.
Measured on
arr.n62.casa, from Dokploy's samples:The gap spans both the TV tracking and Rich metadata milestones, so it is not
all attributable to the cache. But §1 targets 20–40 MB resident and the service
is now above that band, with the one component that has no upper bound sitting
in the middle of it.
Move the cache to disk:
policy row.
logical key rather than the URL, so the API key never becomes part of a cache
key — see the module comment in
cache.rs. A filename derived from that keymust preserve the property. Hash it; do not embed the query string.
half-written body that parses as valid JSON.
waiting to be read. The daily metadata tick (§8) is the obvious lane for it.
filling the disk.
A small in-memory layer in front of the files is fine if it is bounded and the
bound is stated. The defect is unboundedness, not memory as such.
DESIGN.md §9.6 says rich detail "is served through arr-meta's existing 24-hour
response cache" — amend that line to say where the cache lives, since it stops
being an implementation detail once it owns disk.
Non-goals: this is not an image cache. §9.6 hotlinks images from
image.tmdb.organd that stays. It also does not move rich detail into thedatabase — the columns in #145 are still the only persisted metadata.
arr-meta's response cache is now disk-backed (crates/arr-meta,
reliability/158-bounded-cache, PR pending):cache_dir, keyed by FNV-1a hash of the logical request key (never the query string or the API key).DEFAULT_CACHE_MAX_BYTES= 64 MiB, sized from the ~32 MiB of resident growth Dokploy measured across the TV-tracking + rich-metadata milestones).Cache::sweepenforces both, runs after every insert, and is exposed asTmdbClient::sweep_cache().TmdbClientBuilder::cache_dir()lets a caller point it at a persistent directory; unset, it falls back to a process-unique temp directory that's removed on drop (same lifetime the old in-memory cache had).Out of scope here, since arr-daemon is owned by #168/#177 (running in parallel): nothing wires
cache_dir()to bootstrap config or callssweep_cache()from the daily metadata tick (§8) yet. Until that lands, the cache still lives in a temp directory that resets on restart rather than "alongside the database" as the issue asks — functionally bounded, just not yet persistent across restarts. Worth its own follow-up once arr-daemon is free.