buchgr / bazel-remote

A remote cache for Bazel
https://bazel.build
Apache License 2.0
594 stars 154 forks source link

File not closed, will it cause resource leakage? #681

Closed csh2022 closed 1 year ago

csh2022 commented 1 year ago

https://github.com/buchgr/bazel-remote/blob/46ab6a35b660fbfc8869970d805f81eaebec8e10/cache/disk/disk.go#L326C19-L326C19

csh2022 commented 1 year ago

image

mostynb commented 1 year ago

Hi, I think this code is correct- rc is passed to c.proxy.Put(...) as an io.ReadCloser, and the backend proxy's Put function is expected to close the file.