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 d395583  Fix default connection timeout (#563)
d395583 is described below

commit d39558319a259709643f3ee8727eed325901dc9d
Author: xiaolong ran <[email protected]>
AuthorDate: Mon Jul 12 15:49:18 2021 +0800

    Fix default connection timeout (#563)
    
    Signed-off-by: xiaolongran <[email protected]>
    
    
    ### Motivation
    
    In Java SDK, the default connection timeout is **10** sec
    
    ```
    private int connectionTimeoutMs = 10000;
    ```
    
    The problem here is that when the load of the broker is high, there is no 
way to complete the processing and creation of the connection within 5s, which 
will cause the client to constantly create new connections and try to establish 
a connection with the broker, and the broker Continuously disconnecting from 
the client, forming a vicious circle
    
    ### Modifications
    
    Replace 5 sec of connection timeout with `10` sec
---
 pulsar/client_impl.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar/client_impl.go b/pulsar/client_impl.go
index 52ef5b1..7d2fcfd 100644
--- a/pulsar/client_impl.go
+++ b/pulsar/client_impl.go
@@ -30,7 +30,7 @@ import (
 )
 
 const (
-       defaultConnectionTimeout = 5 * time.Second
+       defaultConnectionTimeout = 10 * time.Second
        defaultOperationTimeout  = 30 * time.Second
 )
 

Reply via email to