From be42ff5b207aaebeb1b905d55792f4f6f5d09c37 Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Wed, 19 Mar 2025 15:39:02 -0700 Subject: [PATCH 1/2] Config for MaxWaitConnections --- go.mod | 2 ++ server/server.go | 1 + server/server_config.go | 3 +++ 3 files changed, 6 insertions(+) diff --git a/go.mod b/go.mod index 94ad4ed084..a58ec8af4e 100644 --- a/go.mod +++ b/go.mod @@ -43,3 +43,5 @@ require ( ) go 1.23.3 + +replace github.com/dolthub/vitess => /Users/neil/Documents/vitess diff --git a/server/server.go b/server/server.go index e7f0d6de57..6c4119072c 100644 --- a/server/server.go +++ b/server/server.go @@ -158,6 +158,7 @@ func newServerFromHandler(cfg Config, e *sqle.Engine, sm *SessionManager, handle ConnReadTimeout: cfg.ConnReadTimeout, ConnWriteTimeout: cfg.ConnWriteTimeout, MaxConns: cfg.MaxConnections, + MaxWaitConns: cfg.MaxWaitConnections, ConnReadBufferSize: mysql.DefaultConnBufferSize, AllowClearTextWithoutTLS: cfg.AllowClearTextWithoutTLS, } diff --git a/server/server_config.go b/server/server_config.go index 4ec35e1cd2..084c04b645 100644 --- a/server/server_config.go +++ b/server/server_config.go @@ -57,6 +57,9 @@ type Config struct { ConnWriteTimeout time.Duration // MaxConnections is the maximum number of simultaneous connections that the server will allow. MaxConnections uint64 + // MaxWaitConnections is the maximum number of simultaneous connections that the server will allow to block waiting + // for a connection before new connections result in immediate rejection. + MaxWaitConnections uint32 // TLSConfig is the configuration for TLS on this server. If |nil|, TLS is not supported. TLSConfig *tls.Config // RequestSecureTransport will require incoming connections to be TLS. Requires non-|nil| TLSConfig. From 70cb7522c403d23d098776f83722dad91309a953 Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Fri, 21 Mar 2025 11:08:10 -0700 Subject: [PATCH 2/2] Config pass through for MaxWaitConnsTimeout --- server/server.go | 1 + server/server_config.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/server.go b/server/server.go index 6c4119072c..205147c1bb 100644 --- a/server/server.go +++ b/server/server.go @@ -159,6 +159,7 @@ func newServerFromHandler(cfg Config, e *sqle.Engine, sm *SessionManager, handle ConnWriteTimeout: cfg.ConnWriteTimeout, MaxConns: cfg.MaxConnections, MaxWaitConns: cfg.MaxWaitConnections, + MaxWaitConnsTimeout: cfg.MaxWaitConnectionsTimeout, ConnReadBufferSize: mysql.DefaultConnBufferSize, AllowClearTextWithoutTLS: cfg.AllowClearTextWithoutTLS, } diff --git a/server/server_config.go b/server/server_config.go index 084c04b645..853d622616 100644 --- a/server/server_config.go +++ b/server/server_config.go @@ -60,6 +60,8 @@ type Config struct { // MaxWaitConnections is the maximum number of simultaneous connections that the server will allow to block waiting // for a connection before new connections result in immediate rejection. MaxWaitConnections uint32 + // MaxWaitConnectionsTimeout is the maximum amount of time that a connection will block waiting for a connection + MaxWaitConnectionsTimeout time.Duration // TLSConfig is the configuration for TLS on this server. If |nil|, TLS is not supported. TLSConfig *tls.Config // RequestSecureTransport will require incoming connections to be TLS. Requires non-|nil| TLSConfig.