@@ -82,7 +82,7 @@ func (this *ZookeeperCoordinator) Connect() (err error) {
82
82
83
83
func (this * ZookeeperCoordinator ) tryConnect () (zkConn * zk.Conn , connectionEvents <- chan zk.Event , err error ) {
84
84
Infof (this , "Connecting to ZK at %s\n " , this .config .ZookeeperConnect )
85
- zkConn , connectionEvents , err = zk .Connect (this .config .ZookeeperConnect , this .config .ZookeeperTimeout )
85
+ zkConn , connectionEvents , err = zk .Connect (this .config .ZookeeperConnect , this .config .ZookeeperSessionTimeout )
86
86
return
87
87
}
88
88
@@ -1102,8 +1102,8 @@ type ZookeeperConfig struct {
1102
1102
/* Zookeeper hosts */
1103
1103
ZookeeperConnect []string
1104
1104
1105
- /* Zookeeper read timeout */
1106
- ZookeeperTimeout time.Duration
1105
+ /* Zookeeper session timeout */
1106
+ ZookeeperSessionTimeout time.Duration
1107
1107
1108
1108
/* Max retries for any request except CommitOffset. CommitOffset is controlled by ConsumerConfig.OffsetsCommitMaxRetries. */
1109
1109
MaxRequestRetries int
@@ -1122,7 +1122,7 @@ type ZookeeperConfig struct {
1122
1122
func NewZookeeperConfig () * ZookeeperConfig {
1123
1123
config := & ZookeeperConfig {}
1124
1124
config .ZookeeperConnect = []string {"localhost" }
1125
- config .ZookeeperTimeout = 1 * time .Second
1125
+ config .ZookeeperSessionTimeout = 5 * time .Second
1126
1126
config .MaxRequestRetries = 3
1127
1127
config .RequestBackoff = 150 * time .Millisecond
1128
1128
config .Root = ""
@@ -1152,7 +1152,7 @@ func ZookeeperConfigFromFile(filename string) (*ZookeeperConfig, error) {
1152
1152
setStringSliceConfig (& config .ZookeeperConnect , z ["zookeeper.connect" ], "," )
1153
1153
setStringConfig (& config .Root , z ["zookeeper.kafka.root" ])
1154
1154
1155
- if err := setDurationConfig (& config .ZookeeperTimeout , z ["zookeeper.connection.timeout" ]); err != nil {
1155
+ if err := setDurationConfig (& config .ZookeeperSessionTimeout , z ["zookeeper.connection.session .timeout" ]); err != nil {
1156
1156
return nil , err
1157
1157
}
1158
1158
if err := setIntConfig (& config .MaxRequestRetries , z ["zookeeper.max.request.retries" ]); err != nil {
0 commit comments