Skip to content

Commit

Permalink
HA: Limit max open database connections to 1
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
yhabteab authored and lippserd committed Dec 17, 2024
1 parent a47ccc3 commit ce3309f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/icingadb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ce3309f

Please sign in to comment.