Chromium Code Reviews
Descriptioncipd: instance cache
Cache package instances on file system in a shared cache, as specified
by -cache-dir flag. Use LRU for GC.
The implementation is similar to the one of tag cache: a binary-protobuf
file with cache state is loaded/saved every time it is accessed. The state contains last access time of
instances.
If the state file is not found, corrupted or was not synced with fs for
a long time, the state is synced. Newly discovered instances are
considered last accessed at EPOCH.
GC happens on sync or when an instance is added: cutoff date is
determined and first N instances that were accessed before cutoff date
are removed, where N is the number of instance beyond cache limit.
R=vadimsh@chromium.org
BUG=601017
Committed: https://github.com/luci/luci-go/commit/6c20df86be89df4837ccf85f19827e69b1cf584c
Patch Set 1 #Patch Set 2 : cipd: instance cache #
Total comments: 16
Patch Set 3 : addressed comments #
Total comments: 2
Patch Set 4 : read/write state file each time #Patch Set 5 : add tests, fix gc #
Total comments: 10
Patch Set 6 : restore check, improve comment #
Depends on Patchset: Messages
Total messages: 23 (10 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||