You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nodece (via GitHub)" <gi...@apache.org> on 2023/03/20 18:06:01 UTC

[GitHub] [pulsar] nodece commented on a diff in pull request #19762: [fix][broker] Fix create cluster with empty url

nodece commented on code in PR #19762:
URL: https://github.com/apache/pulsar/pull/19762#discussion_r1142509932


##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/URIPreconditions.java:
##########
@@ -67,7 +67,7 @@ public static void checkURIIfPresent(@Nullable String uri,
     public static void checkURIIfPresent(@Nullable String uri,
                                          @Nonnull Predicate<URI> predicate,
                                          @Nullable String errorMessage) throws IllegalArgumentException {
-        if (uri == null) {
+        if (uri == null || uri.length() == 0) {

Review Comment:
   > I think one risk here is that it is now possible to create a cluster with all empty cluster urls. I think it might make sense to verify that there is some URL that is not zero length.
   
   Sure, I agreed with you! We must ensure that at least one URL is a non-zero length when creating the cluster.
   
   Do you make a PR to do that? Recently, I don't have time to maintain the Pulsar :(
   
   
   



##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/URIPreconditions.java:
##########
@@ -67,7 +67,7 @@ public static void checkURIIfPresent(@Nullable String uri,
     public static void checkURIIfPresent(@Nullable String uri,
                                          @Nonnull Predicate<URI> predicate,
                                          @Nullable String errorMessage) throws IllegalArgumentException {
-        if (uri == null) {
+        if (uri == null || uri.length() == 0) {

Review Comment:
   @michaeljmarshall 



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org