BewareMyPower opened a new pull request #11029:
URL: https://github.com/apache/pulsar/pull/11029


   Fixes #10747 
   
   ### Motivation
   
   This PR is a catchup of https://github.com/apache/pulsar/pull/2852 and adds 
connection timeout configuration to C++ and Python client.
   
   ### Modifications
   
   - Add a `PeriodicTask` class to execute tasks periodically and the relate 
unit tests: `PeriodicTastTest`.
   - Use `PeriodicTask` to register a timer before connecting to broker 
asynchronously, if the connection was not established when the timer is 
triggered, close the socket so that `handleTcpConnected` can be triggered 
immediately with a failure.
   - Add connection timeout (in milliseconds) to both C++ and Python clients.
   - Add `ClientTest.testConnectTimeout` (C++) and `test_connect_timeout` 
(Python) and  to verify the connection timeout works.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   - PeriodicTaskTest
   - ClientTest.testConnectTimeout
   - test_connect_timeout
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (**yes**)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)


-- 
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:
[email protected]


Reply via email to