Skip to content

Commit

Permalink
Merge branch 'master' into test-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
machine424 authored Jan 14, 2025
2 parents f333107 + 1bd157f commit 4acdd2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 0 additions & 9 deletions cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,18 +997,12 @@ func main() {
listeners, err := webHandler.Listeners()
if err != nil {
logger.Error("Unable to start web listener", "err", err)
if err := queryEngine.Close(); err != nil {
logger.Warn("Closing query engine failed", "err", err)
}
os.Exit(1)
}

err = toolkit_web.Validate(*webConfig)
if err != nil {
logger.Error("Unable to validate web configuration file", "err", err)
if err := queryEngine.Close(); err != nil {
logger.Warn("Closing query engine failed", "err", err)
}
os.Exit(1)
}

Expand All @@ -1030,9 +1024,6 @@ func main() {
case <-cancel:
reloadReady.Close()
}
if err := queryEngine.Close(); err != nil {
logger.Warn("Closing query engine failed", "err", err)
}
return nil
},
func(err error) {
Expand Down
2 changes: 2 additions & 0 deletions promql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ func NewEngine(opts EngineOpts) *Engine {
}

// Close closes ng.
// Callers must ensure the engine is really no longer in use before calling this to avoid
// issues failures like in https://github.com/prometheus/prometheus/issues/15232
func (ng *Engine) Close() error {
if ng == nil {
return nil
Expand Down

0 comments on commit 4acdd2a

Please sign in to comment.