diff --git a/promql/query_logger.go b/promql/query_logger.go index 2c324fb90..716e7749b 100644 --- a/promql/query_logger.go +++ b/promql/query_logger.go @@ -64,6 +64,7 @@ func logUnfinishedQueries(filename string, filesize int, logger log.Logger) { level.Error(logger).Log("msg", "Failed to open query log file", "err", err) return } + defer fd.Close() brokenJSON := make([]byte, filesize) _, err = fd.Read(brokenJSON)