Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit fd568d4

Browse files
authored
Merge pull request #398 from erizocosmico/fix/timeouts
server: do not set timeouts by default
2 parents 68ca6b2 + ec6d226 commit fd568d4

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

server/server.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ import (
99
"gopkg.in/src-d/go-vitess.v1/mysql"
1010
)
1111

12-
const (
13-
DefaultConnReadTimeout = 30 * time.Second
14-
DefaultConnWriteTimeout = 60 * time.Second
15-
)
16-
1712
// Server is a MySQL server for SQLe engines.
1813
type Server struct {
1914
Listener *mysql.Listener
@@ -50,12 +45,12 @@ func NewServer(cfg Config, e *sqle.Engine, sb SessionBuilder) (*Server, error) {
5045
tracer = opentracing.NoopTracer{}
5146
}
5247

53-
if cfg.ConnReadTimeout == 0 {
54-
cfg.ConnReadTimeout = DefaultConnReadTimeout
48+
if cfg.ConnReadTimeout < 0 {
49+
cfg.ConnReadTimeout = 0
5550
}
5651

57-
if cfg.ConnWriteTimeout == 0 {
58-
cfg.ConnWriteTimeout = DefaultConnWriteTimeout
52+
if cfg.ConnWriteTimeout < 0 {
53+
cfg.ConnWriteTimeout = 0
5954
}
6055

6156
handler := NewHandler(e, NewSessionManager(sb, tracer, cfg.Address))

0 commit comments

Comments
 (0)