pkg/cloud: ResumingReader incorrectly forgets to call .Close()
on its ReadCloser
#75143
Labels
A-disaster-recovery
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-disaster-recovery
Describe the problem
Since go 1.17.6, it has become critical to call
.Close()
on the Body field of a http Response object, for otherwise we get goroutine leaks.(see #74657, golang/go#50652 and #75136)
Thanks to #75136, we're now doing a pretty good job of doing so in most cases, except for the following:
cloud/httpsink/(*httpStorage).ReadFileAt
callsopenStreamAt
which returns a http.Responseio.ReadCloser
tocloud.NewResumingReader
,.Close()
when the Reader is reset inRead()
, whenRetryOnErrFn
returns true(NB I've found it hard to read through the implementation of the methods of
cloud.ReadResumer
, it was expecting some kind of disciplined centralization of the invariants on the ReadCloser - maybe there's some improvement to make there)cc @adityamaru for triage
The text was updated successfully, but these errors were encountered: