fix: serve always only the latest objects (#12487)

due to a historic bug, it is possible that
some objects might exist on multiple pools,
rely on ModTime to return the correct pool.
This commit is contained in:
Harshavardhana
2021-06-10 23:07:16 -07:00
committed by GitHub
parent b154581b65
commit 0385ecbf34
2 changed files with 81 additions and 11 deletions

View File

@@ -792,6 +792,9 @@ func NewGetObjectReader(rs *HTTPRangeSpec, oi ObjectInfo, opts ObjectOptions) (
// Close - calls the cleanup actions in reverse order
func (g *GetObjectReader) Close() error {
if g == nil {
return nil
}
// sync.Once is used here to ensure that Close() is
// idempotent.
g.once.Do(func() {