metacache: Always close the s2 writer (#10836)

The s2 writer could be leaked if there was an error.

Make sure it is always closed.
This commit is contained in:
Klaus Post
2020-11-05 07:30:14 -08:00
committed by GitHub
parent 71753e21e0
commit d1e1205036
2 changed files with 9 additions and 51 deletions

View File

@@ -47,11 +47,6 @@ func loadMetacacheSampleEntries(t testing.TB) metaCacheEntriesSorted {
if err != io.EOF {
t.Fatal(err)
}
if false {
w := newMetacacheFile("testdata/metacache-new.s2")
w.write(entries.entries()...)
w.Close()
}
return entries
}