From 98f78db915a1021c187e14a2652b27d0598ac0e7 Mon Sep 17 00:00:00 2001 From: Aiden Andrews-McDermott Date: Fri, 27 Dec 2019 18:08:17 +0000 Subject: [PATCH] Updated config.go to remove the defaulting idle connection limit of 5 which is an issue for upstream https://github.com/go-sql-driver/mysql/issues/674 --- storage/sql/config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/sql/config.go b/storage/sql/config.go index 827b0df1..f3dede4a 100644 --- a/storage/sql/config.go +++ b/storage/sql/config.go @@ -308,6 +308,13 @@ func (s *MySQL) open(logger log.Logger) (*conn, error) { return nil, err } + if s.MaxIdleConns == 0 { + /*Override default behaviour to fix https://github.com/dexidp/dex/issues/1608*/ + db.SetMaxIdleConns(0) + } else { + db.SetMaxIdleConns(s.MaxIdleConns) + } + err = db.Ping() if err != nil { if mysqlErr, ok := err.(*mysql.MySQLError); ok && mysqlErr.Number == mysqlErrUnknownSysVar {