Skip to content

Commit

Permalink
s3: update timestamps in Contains() also
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mostynb committed Jan 4, 2023
1 parent be88dad commit 2dc254f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cache/s3proxy/s3proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ func (c *s3Cache) Contains(ctx context.Context, kind cache.EntryKind, hash strin
size = s.Size
}

if exists && c.updateTimestamps {
// TODO: check if this hurts performance.
c.UpdateModificationTimestamp(ctx, c.bucket, c.objectKey(hash, kind))
}

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

return exists, size
Expand Down

0 comments on commit 2dc254f

Please sign in to comment.