Skip to content

Commit be42ff5

Browse files
committed
Config for MaxWaitConnections
1 parent 47285a5 commit be42ff5

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ require (
4343
)
4444

4545
go 1.23.3
46+
47+
replace github.com/dolthub/vitess => /Users/neil/Documents/vitess

server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func newServerFromHandler(cfg Config, e *sqle.Engine, sm *SessionManager, handle
158158
ConnReadTimeout: cfg.ConnReadTimeout,
159159
ConnWriteTimeout: cfg.ConnWriteTimeout,
160160
MaxConns: cfg.MaxConnections,
161+
MaxWaitConns: cfg.MaxWaitConnections,
161162
ConnReadBufferSize: mysql.DefaultConnBufferSize,
162163
AllowClearTextWithoutTLS: cfg.AllowClearTextWithoutTLS,
163164
}

server/server_config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ type Config struct {
5757
ConnWriteTimeout time.Duration
5858
// MaxConnections is the maximum number of simultaneous connections that the server will allow.
5959
MaxConnections uint64
60+
// MaxWaitConnections is the maximum number of simultaneous connections that the server will allow to block waiting
61+
// for a connection before new connections result in immediate rejection.
62+
MaxWaitConnections uint32
6063
// TLSConfig is the configuration for TLS on this server. If |nil|, TLS is not supported.
6164
TLSConfig *tls.Config
6265
// RequestSecureTransport will require incoming connections to be TLS. Requires non-|nil| TLSConfig.

0 commit comments

Comments
 (0)