bazelbuild / bazel-buildfarm

Bazel remote caching and execution service
https://bazel.build
Apache License 2.0
635 stars 199 forks source link

[ZstdCompression] Read request with offset incorrectly fails with not_found error and removes blob #1757

Closed amishra-u closed 4 weeks ago

amishra-u commented 1 month ago

Bug

When Bazel sends a read request with a non-zero offset and the compression flag set, the read request incorrectly fails with a not_found error.

Why

When a read request has a non-zero offset, it attempts to skip the specified number of bytes in the input stream. However, the skip functionality is not implemented for ZstdCompressingInputStream, which results in an IOException. This IOException is incorrectly classified as not_found. As a result, the blob location is removed from the backplane, causing the subsequent read requests for same digest also fails with a not_found error in the same build where the action cache check has already been completed.