Skip to content

Conversation

@ivankelly
Copy link
Contributor

Allows the client to specify how long to wait for brokers to respond.

Allows the client to specify how long to wait for brokers to respond.
@ivankelly ivankelly added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/client labels Oct 26, 2018
@ivankelly ivankelly self-assigned this Oct 26, 2018
@ivankelly
Copy link
Contributor Author

@cckellogg

@merlimat
Copy link
Contributor

run integration tests

1 similar comment
@merlimat
Copy link
Contributor

run integration tests

@ivankelly
Copy link
Contributor Author

rerun integration tests

.connectionTimeout(24, TimeUnit.HOURS).build()) {
CompletableFuture<Producer<byte[]>> f = client.newProducer().topic("foo").createAsync();

Thread.sleep(12000); // sleep for 12 seconds (default timeout is 10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reduce the default timeout and change the sleep here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default timeout is a behavioral change. Currently, it's 10 seconds hardcoded. It does suck that it added 12 seconds to all test runs. A better option would be to disable or just remove this test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make the timeout configurable and reduce it in the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole patch is making the timeout configurable. this test is to check that times configured more than the default take effect. I think the easiest would be to just remove this test. Testing that is takes effect is already tested by the other test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

@ivankelly ivankelly added this to the 2.3.0 milestone Oct 29, 2018
@merlimat
Copy link
Contributor

merlimat commented Nov 8, 2018

run integration tests

@ivankelly
Copy link
Contributor Author

rerun integration tests

@ivankelly
Copy link
Contributor Author

rerun java8 tests

@sijie sijie merged commit efa040f into apache:master Nov 16, 2018
sijie pushed a commit that referenced this pull request Jun 25, 2021
Fixes #10747 

### Motivation

This PR is a catchup of #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
codelipenghui pushed a commit that referenced this pull request Aug 5, 2021
Fixes #10747 

### Motivation

This PR is a catchup of #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

(cherry picked from commit 6062d2f)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
Fixes apache#10747 

### Motivation

This PR is a catchup of apache#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
merlimat pushed a commit to apache/pulsar-client-python that referenced this pull request Sep 29, 2022
Fixes #10747 

### Motivation

This PR is a catchup of apache/pulsar#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants