You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/21 07:51:18 UTC

[GitHub] [pulsar-client-go] jonyhy96 opened a new issue #257: Retry count limit in reconnectToBroker

jonyhy96 opened a new issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257


   **Is your feature request related to a problem? Please describe.**
   Once the connection is closed the reconnectToBroker logic of both producer and consumer will try to reconnect to the broker infinatly.
   
   **Describe the solution you'd like**
   Add a field in the `Options` represent the max number of retries and add a default number.
   
   **Describe alternatives you've considered**
   The client will stop retry reconnect to the broker under a limit number  of retries.
   
   **Additional context**
   I can make a pr of this If we all agree with this is a needed feature


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] jonyhy96 commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
jonyhy96 commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-632443576


   @jiazhai Thanks for reply.
   > This behavior looks fine. It could avoid user to manually reconnect.
   I also like this auto reconnect feature but i think maybe we can give the ability of config this behavior to the user, so users can decide the max number of retry should the client make.
   
   I'm facing the problem that when i running a consumer inside a kubernetes pod,if network error happens or the pulsar broker is terminated, it will try to reconnect to the broker infinitely.
   This could be a waste of resources.If this behavior is configurable or there is some retry policy i can chose will help a lot.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] jonyhy96 commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
jonyhy96 commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-636593540


   > The current number of retries is limited and the value of OperationTimeout. The default value is 30s. If there is no successful retry within the time of OperationTimeout, the attempt will not continue.
   > 
   > Reference to [get_conn](https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/rpc_client.go#L114-L129)
   
   Thanks for reply,the get_conn will timeout in default 30s or given OperationTimeout,but the [reconnectToBroker](https://github.com/apache/pulsar-client-go/blob/master/pulsar/producer_partition.go#L188) will runs infinitly.
   
   You can recurrent this by handlely terminate pulsar cluster after client successfully create a producer/consumer.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] jonyhy96 commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
jonyhy96 commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-679107105


   > Thanks @jonyhy96 feedback, I think this is a good proposal, can you send a pull request to improve this?
   
   Sure, I'll send a pull request on this very soon.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] jiazhai commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-632431719


   @jonyhy96 Thanks for reporting this issue. In java side the first time connect will be limited by the operation timeout(30s); But once it get success connect, when the network error happens, the client will try to reconnect infinitely(if not killed by user).
   This behavior looks fine. It could avoid user to manually reconnect. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-678918433


   Thanks @jonyhy96 feedback, I think this is a good proposal, can you send a pull request to improve this?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] jonyhy96 edited a comment on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
jonyhy96 edited a comment on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-632443576


   @jiazhai Thanks for reply.
   > This behavior looks fine. It could avoid user to manually reconnect.
   
   I also like this auto reconnect feature but i think maybe we can give the ability of config this behavior to the user, so users can decide the max number of retry should the client make.
   
   I'm facing the problem that when i running a consumer inside a kubernetes pod,if network error happens or the pulsar broker is terminated, it will try to reconnect to the broker infinitely.
   This could be a waste of resources.If this behavior is configurable or there is some retry policy i can chose will help a lot.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy closed issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
wolfstudy closed issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #257: Retry number limit in reconnectToBroker

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #257:
URL: https://github.com/apache/pulsar-client-go/issues/257#issuecomment-636434622


   The current number of retries is limited and the value of OperationTimeout. The default value is 30s. If there is no successful retry within the time of OperationTimeout, the attempt will not continue.
   
   Reference to [get_conn](https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/rpc_client.go#L114-L129)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org