Skip to content

Commit

Permalink
Don't skip the orphan cleanup when channel is disabled or the broker …
Browse files Browse the repository at this point in the history
…is not found
  • Loading branch information
BewareMyPower committed Oct 10, 2024
1 parent 2e5dab7 commit 35fd689
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1520,22 +1520,20 @@ private synchronized void doCleanup(String broker, boolean gracefully) {

// if not gracefully, verify the broker is inactive by health-check.
if (!gracefully) {
if (channelDisabled()) {
return;
}
try {
healthCheckBrokerAsync(broker).get(
pulsar.getConfiguration().getMetadataStoreOperationTimeoutSeconds(), SECONDS);
log.warn("Found that the broker to clean is healthy. Skip the broker:{}'s orphan bundle cleanup",
broker);
return;
} catch (Exception e) {
if (e instanceof ExecutionException && e.getCause() instanceof PulsarAdminException.NotFoundException) {
log.info("The broker is not healthy, skip {}'s orphan bundle cleanup", broker);
return;
}
if (debug()) {
log.info("Failed to check broker:{} health", broker, e);
if (e instanceof ExecutionException
&& e.getCause() instanceof PulsarAdminException.NotFoundException) {
log.info("The broker {} is not healthy because it's not found", broker);
} else {
log.info("Failed to check broker:{} health", broker, e);
}
}
log.info("Checked the broker:{} health. Continue the orphan bundle cleanup", broker);
}
Expand Down

0 comments on commit 35fd689

Please sign in to comment.