sourcegraph/internal/diskcache
Keegan Carruthers-Smith 3f1b6bcfcf
searcher: TMPDIR on CACHE_DIR (#36160)
Structural search writes to $TMPDIR, leading to evictions since that is
just the normal ephemeral storage on a pod (not tuned). We move
TMPDIR to CACHE_DIR and update diskcache to evict based on all
file sizes, not just zips. Structural writes zips, and it should be safe to
evict those files even if comby is reading them due to it having an open
file descriptor.

Kubernetes evicts searchers if they go too far over the cache size. This
means we need to maintain our cache size for all files, not just zip
files. We can only safely remove zip files, so we still only remove
those. But when making eviction decisions, it is now based on the total
size of the cache dir, not just the size of zip files within.

Test Plan: added a unit test. It was useful since info.Size() works on a
directory but we want to ignore that.
2022-06-03 04:58:15 +00:00
..
cache_test.go searcher: TMPDIR on CACHE_DIR (#36160) 2022-06-03 04:58:15 +00:00
cache.go searcher: TMPDIR on CACHE_DIR (#36160) 2022-06-03 04:58:15 +00:00
CODENOTIFY all: add keegancsmith to CODENOTIFY for many pkgs (#14241) 2020-09-29 11:03:53 +02:00
context.go all: use any instead of interface{} (#35102) 2022-05-09 10:59:39 +02:00
observability.go diskcache: fix use-after-finish for background fetch (#29006) 2021-12-14 20:52:50 +00:00
url_mutex.go Rename pkg to internal (#5898) 2019-10-07 15:36:41 -07:00