-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Reopen][Issue 5597] Retry when getPartitionedTopicMetadata failed #5844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jiazhai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @murong00 for figuring out the issue. Would you please help add a unit test for the retry logic to make the code protected.
|
@murong00 Seems there was a test case |
|
@jiazhai ok, will improve it later. |
|
@jiazhai fix the unit test, please help to review again. |
| String urlsWithUnreached = "http://localhost:51000,localhost:" + BROKER_WEBSERVICE_PORT; | ||
| if (isTcpLookup) { | ||
| url = "pulsar://localhost:51000,localhost:51001"; | ||
| urlsWithUnreached = "pulsar://localhost:51000,localhost::" + BROKER_PORT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localhost::" + BROKER_PORT . there are 2 ":" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks.
|
|
||
| @Test (timeOut = 4000) | ||
| public void testGetPartitionedTopicDataTimeout() { | ||
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we create a new test case, the original one is to test timeout, while your new test is try to test retry and success. also how about add some comments or change the test case name to make it more clear? e.g. according to the test steps, the name like 'testMultiHostUrlRetrySuccess' would be better. And some of the test cases are not related with PulsarBrokerStatsClientTest, It would be better to move them to or create a more related test suite, such as PulsarMultiHostClientTest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice advice, have fixed it.
|
Thanks @murong00 for the help, over all looks good to me. left some minor comments. |
|
run java8 tests |
|
run java8 tests |
|
need fix NPE in |
|
run java8 tests |
|
run cpp tests |
1 similar comment
|
run cpp tests |
|
@sijie The retry logic may skip the limit of lookup throttle which can be set on client or server side (e.g. |
|
Meanwhile, fixed some unit test by setting |
|
retest this please |
|
run java8 tests |
|
run java8 tests error: |
|
run integration tests |
|
run java8 tests |
4 similar comments
|
run java8 tests |
|
run java8 tests |
|
run java8 tests |
|
run java8 tests |
…pache#5844) Motivation Fixes apache#5597 Add backoff retries when getting partitioned metadata from brokers. The change in apache#5734 (copy from apache#5603) used the wrong time unit when inited Backoff which failed to trigger the retry logic as expected. Modifications Correct the time unit and add some useful log.
Motivation
Fixes #5597
Add backoff retries when getting partitioned metadata from brokers.
The change in #5734 (copy from #5603) used the wrong time unit when inited
Backoffwhich failed to trigger the retry logic as expected.Modifications
Correct the time unit and add some useful log.