This is an automated email from the ASF dual-hosted git repository.
rxl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 110b99d Reduce the default TCP connection timeout from 30 to 5
seconds (#415)
110b99d is described below
commit 110b99d1c88f3d34e9edbe40d957609421d35c25
Author: Matteo Merli <[email protected]>
AuthorDate: Fri Dec 11 23:58:18 2020 -0800
Reduce the default TCP connection timeout from 30 to 5 seconds (#415)
### Motivation
The default TCP connection timeout of 30 seconds is too high. The
connection timeout should be low enough such that we can recover a producer
session with brokers before the operation or the publish timeouts expired
(default is 30sec for both).
5 seconds is a better default value for this scope.
---
pulsar/client.go | 2 +-
pulsar/client_impl.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pulsar/client.go b/pulsar/client.go
index af92f84..95ea2f6 100644
--- a/pulsar/client.go
+++ b/pulsar/client.go
@@ -80,7 +80,7 @@ type ClientOptions struct {
// This parameter is required
URL string
- // Timeout for the establishment of a TCP connection (default: 30
seconds)
+ // Timeout for the establishment of a TCP connection (default: 5
seconds)
ConnectionTimeout time.Duration
// Set the operation timeout (default: 30 seconds)
diff --git a/pulsar/client_impl.go b/pulsar/client_impl.go
index c997c2b..b7950eb 100644
--- a/pulsar/client_impl.go
+++ b/pulsar/client_impl.go
@@ -34,7 +34,7 @@ import (
)
const (
- defaultConnectionTimeout = 30 * time.Second
+ defaultConnectionTimeout = 5 * time.Second
defaultOperationTimeout = 30 * time.Second
)