cache: do not evict entry on ErrClosedPipe (#8432)

Fixes: #8431. If client prematurely closes the read end of the pipe,
cache entry should not be evicted.
This commit is contained in:
poornas 2019-10-22 15:04:25 -07:00 committed by Harshavardhana
parent 40fcd3dc48
commit f01d53b20f

View File

@ -583,8 +583,9 @@ func (c *diskCache) bitrotReadFromCache(ctx context.Context, filePath string, of
if _, err := io.Copy(writer, bytes.NewReader((*bufp)[blockOffset:blockOffset+blockLength])); err != nil {
if err != io.ErrClosedPipe {
logger.LogIf(ctx, err)
return err
}
return err
eof = true
}
if eof {
break