Skip to content

Commit b1382dc

Browse files
committed
s3: update timestamps in Contains() also
When the s3.update_timestamps option is enabled, we update the timestamp of any blob after it is successfully retried from the backend. We should do the same when checking for blob existence in the Contains() function. I don't think this is sufficient to make builds-without-the-bytes work with the s3 proxy backend when eviction is enabled, but it might help. Relates to #624.
1 parent be88dad commit b1382dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cache/s3proxy/s3proxy.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ func (c *s3Cache) Contains(ctx context.Context, kind cache.EntryKind, hash strin
250250
err = errNotFound
251251
} else if kind != cache.CAS || !c.v2mode {
252252
size = s.Size
253+
254+
if c.updateTimestamps {
255+
// TODO: check if this hurts performance.
256+
c.UpdateModificationTimestamp(ctx, c.bucket, c.objectKey(hash, kind))
257+
}
253258
}
254259

255260
logResponse(c.accessLogger, "CONTAINS", c.bucket, c.objectKey(hash, kind), err)

0 commit comments

Comments
 (0)