From 9744de20cc1707d7514c695ef231dce8245711c6 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Wed, 14 Mar 2018 13:08:40 +0530 Subject: [PATCH] Close file for windows platform Windows needs files that are being deleted to be closed. Fixes: https://github.com/prometheus/prometheus/issues/3956 Signed-off-by: Goutham Veeramachaneni --- repair.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repair.go b/repair.go index e9f2a9643..cc0f6e4a9 100644 --- a/repair.go +++ b/repair.go @@ -61,6 +61,9 @@ func repairBadIndexVersion(logger log.Logger, dir string) error { if err := repl.Close(); err != nil { return err } + if err := broken.Close(); err != nil { + return err + } if err := renameFile(repl.Name(), broken.Name()); err != nil { return err }