Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
eolivelli committed May 1, 2024
1 parent 1693cbb commit 32ada91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ private void internalRetryableDeleteNamespaceAsync0(boolean force, int retryTime
final Throwable rc = FutureUtil.unwrapCompletionException(error);
if (rc instanceof MetadataStoreException) {
if (rc.getCause() != null && rc.getCause() instanceof KeeperException.NotEmptyException) {
KeeperException.NotEmptyException ne = (KeeperException.NotEmptyException) rc.getCause();
KeeperException.NotEmptyException ne =
(KeeperException.NotEmptyException) rc.getCause();
log.info("[{}] There are in-flight topics created during the namespace deletion, "
+ "retry to delete the namespace again. (path {} is not empty on metadata)",
namespaceName, ne.getPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,14 @@ default CompletableFuture<Void> deleteIfExists(String path, Optional<Long> expec
return delete(path, expectedVersion)
.exceptionally(e -> {
if (e.getCause() instanceof NotFoundException) {
LOGGER.info("Path {} not found while deleting (this is not a problem)", path);
return null;
} else {
LOGGER.info("Failed to delete path {} with expected version {}", path, expectedVersion, e);
if (expectedVersion.isEmpty()) {
LOGGER.info("Failed to delete path {}", path, e);
} else {
LOGGER.info("Failed to delete path {} with expected version {}", path, expectedVersion, e);
}
throw new CompletionException(e);
}
});
Expand Down

0 comments on commit 32ada91

Please sign in to comment.