Demogorgon314 commented on code in PR #23230:
URL: https://github.com/apache/pulsar/pull/23230#discussion_r1738190091
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -401,10 +404,33 @@ public void start() throws PulsarServerException {
this.serviceUnitStateChannel.listen(splitManager);
this.leaderElectionService.start();
pulsar.runWhenReadyForIncomingRequests(() -> {
- try {
- this.serviceUnitStateChannel.start();
- } catch (Exception e) {
- failStarting(e);
+ int retry = 0;
+ while (!Thread.currentThread().isInterrupted()) {
+ try {
+ brokerRegistry.register();
+ this.serviceUnitStateChannel.start();
+ break;
+ } catch (Exception e) {
+ log.warn("The broker:{} failed to start service unit
state channel. Retrying {} th ...",
+ pulsar.getBrokerId(), ++retry, e);
+ try {
+ TimeUnit.SECONDS.sleep(Math.min(retry * 10L,
MAX_ROLE_CHANGE_RETRY_DELAY_IN_MILLIS));
Review Comment:
I want to set the max retry count, but since like the `Backoff` doesn't
support it.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]