New issue
Advanced search Search tips

Issue 702159 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

corrupted named cache crashes all subsequent isolated runs

Project Member Reported by mar...@chromium.org, Mar 16 2017

Issue description

https://chromium-swarm.appspot.com/bot?id=skia-rpi-116 got a corrupted /b/s/c/state.json, it was 0 bytes instead of '{}'.

In theory the Swarming bot calls run_isolated --clean to ensure the caches are clean but this didn't work, since the named cache code can't clean when state.json is corrupted.

https://github.com/luci/luci-py/blob/master/client/run_isolated.py#L796
lru.LRUDict.load(state_path) is not in a try/except:
https://github.com/luci/luci-py/blob/master/client/named_cache.py#L69

AI:
- Create CacheManager.cleanup() and move code in clean_caches() there.
- Make the cleanup() and normal code paths resilient to broken cache.
- When state.json is corrupted, all caches should be deleted.
 

Comment 1 by no...@chromium.org, Mar 16 2017

Status: Started (was: Assigned)

Comment 2 by no...@chromium.org, Mar 16 2017

> - Create CacheManager.cleanup() and move code in clean_caches() there.

Most of the code in clean_caches deals with named caches and isolate cache at the same time, but CacheManager is specific to named caches. The code specific to named cache cleaning is in CacheManager.trim()

- Make the cleanup() and normal code paths resilient to broken cache.

Done in https://codereview.chromium.org/2752293002/

- When state.json is corrupted, all caches should be deleted.

Done in https://codereview.chromium.org/2752293002/
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/github.com/luci/luci-py.git/+/c497fefe848a225036b03dc7b44454c0c16a55d3

commit c497fefe848a225036b03dc7b44454c0c16a55d3
Author: nodir <nodir@chromium.org>
Date: Tue Mar 28 22:56:22 2017

named_caches: make more resilient to corrupted state

A state file may be corrupted. Make CacheManager.open() purge cache dir
if so.

R=maruel@chromium.org
BUG= 702159 

Review-Url: https://codereview.chromium.org/2752293002

[modify] https://crrev.com/c497fefe848a225036b03dc7b44454c0c16a55d3/client/named_cache.py
[modify] https://crrev.com/c497fefe848a225036b03dc7b44454c0c16a55d3/client/tests/named_cache_test.py

Comment 4 by no...@chromium.org, Mar 28 2017

I think this is fixed?

Comment 5 by mar...@chromium.org, Mar 29 2017

Status: Fixed (was: Started)
The problem yes, the code itself no. I'll still close the issue since there's no urgency.

Sign in to add a comment