-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Fix create cluster with empty url #19762
Conversation
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
5766204
to
472687a
Compare
/pulsarbot rerun-failure-checks |
1 similar comment
/pulsarbot rerun-failure-checks |
472687a
to
6a0fd33
Compare
/pulsarbot rerun-failure-checks |
d7d7782
to
c1e495d
Compare
Signed-off-by: Zixuan Liu <[email protected]>
c1e495d
to
3ec995c
Compare
@@ -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) { |
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.
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.
Additionally, one benefit of this change is for clusters that only want to supply a TLS url.
What is your opinion @nodece?
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.
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 :(
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.
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.
I'll create a GitHub issue and label it as a good one for first time contributors.
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.
I created #19866.
Also, while looking into it, I realized that this PR didn't introduce the possibility of configuring no urls. The issue I created is very low priority.
Motivation
When creating the cluster, if the
serviceUrlTls
is empty in theClusterData
, I gotIllegal service tls url, example: https://pulsar.example.com:8443
. I expect the Pulsar works fine.#19151 breaks this behavior, see the following code:
This check should also ignore the empty URL.
Modifications
Verifying this change
Added
testCreateCluster
test.Documentation
doc
doc-required
doc-not-needed
doc-complete