cache: fix race on reloading mutableref

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2017-12-08 21:54:27 -08:00
parent 41cd660444
commit d4a82e4584
1 changed files with 1 additions and 1 deletions

2
cache/manager.go vendored
View File

@ -117,7 +117,7 @@ func (cm *cacheManager) get(ctx context.Context, id string, opts ...RefOption) (
}
func (cm *cacheManager) load(ctx context.Context, id string, opts ...RefOption) (*cacheRecord, error) {
if rec, ok := cm.records[id]; ok {
if rec, ok := cm.records[id]; ok && !rec.dead {
return rec, nil
}