From ce3309f0c9a83ad620cf305608d094c4a8c2e847 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 23 Oct 2024 14:10:54 +0200 Subject: [PATCH] HA: Limit max open database connections to `1` Previously, the HA feature was allowed to open `max_connections` database connection in parallel to other Icinga DB components. Meaning, Icinga DB wasn't limited to the configured `max_connections`, but effectively to `2 * max_connections`. --- cmd/icingadb/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/icingadb/main.go b/cmd/icingadb/main.go index 32fafa871..3b17873da 100644 --- a/cmd/icingadb/main.go +++ b/cmd/icingadb/main.go @@ -114,6 +114,7 @@ func run() int { logger.Fatalf("%+v", errors.Wrap(err, "can't create database connection pool from config")) } defer func() { _ = db.Close() }() + db.SetMaxOpenConns(1) ha = icingadb.NewHA(ctx, db, heartbeat, logs.GetChildLogger("high-availability")) telemetryLogger := logs.GetChildLogger("telemetry")