mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcd: add a read/write timeout to server
The default is for connections to last forever[1]. This leads to fds leaking. I set the timeout so high by default so that watches don't have to keep retrying but perhaps we should set it slower. Tested on a cluster with lots of clients and it seems to have relieved the problem. [1] https://groups.google.com/forum/#!msg/golang-nuts/JFhGwh1q9xU/heh4J8pul3QJ
This commit is contained in:
@@ -3,10 +3,16 @@ package server
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/etcd/log"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultReadTimeout = float64((5 * time.Minute) / time.Second)
|
||||
DefaultWriteTimeout = float64((5 * time.Minute) / time.Second)
|
||||
)
|
||||
|
||||
// TLSServerConfig generates tls configuration based on TLSInfo
|
||||
// If any error happens, this function will call log.Fatal
|
||||
func TLSServerConfig(info *TLSInfo) *tls.Config {
|
||||
|
||||
Reference in New Issue
Block a user