Skip to content

Commit ce3309f

Browse files
yhabteablippserd
authored andcommitted
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`.
1 parent a47ccc3 commit ce3309f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/icingadb/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func run() int {
114114
logger.Fatalf("%+v", errors.Wrap(err, "can't create database connection pool from config"))
115115
}
116116
defer func() { _ = db.Close() }()
117+
db.SetMaxOpenConns(1)
117118
ha = icingadb.NewHA(ctx, db, heartbeat, logs.GetChildLogger("high-availability"))
118119

119120
telemetryLogger := logs.GetChildLogger("telemetry")

0 commit comments

Comments
 (0)