metacache: Always close block writer (#10973)

In some cases a writer could be left behind unclosed, leaking compression blocks.

Always close and set compression concurrency to 2 which should be fine to keep up.
This commit is contained in:
Klaus Post
2020-11-25 09:37:30 -08:00
committed by GitHub
parent 31e6f60847
commit 0422eda6a2
2 changed files with 4 additions and 2 deletions

View File

@@ -370,6 +370,7 @@ func Test_newMetacacheStream(t *testing.T) {
r := loadMetacacheSample(t)
var buf bytes.Buffer
w := newMetacacheWriter(&buf, 1<<20)
defer w.Close()
err := r.readFn(func(object metaCacheEntry) bool {
err := w.write(object)
if err != nil {