-
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
CommandLookupTopic.advertisedListenerName may be blank #14304
Comments
pulsar/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java Lines 820 to 822 in 2d09237
@EronWright - were you able to reproduce this issue with the Java client? Based on the code you reference, it looks like the I can see in the Go client, we are using string type instead of a string reference ( I agree with your proposed solution, but I am concerned that this is a point of ambiguity in the spec that should be better defined. I'd also like to understand how we're seeing this issue with the Java client since it looks like it |
@michaeljmarshall thanks for the review. I believe that I'm trying to write a test into |
I don't believe this is correct. If you look at the protobuf field definition, the
I just ran a quick test to double check my understanding, and this test passes: @Test
public void testAdvertisedListenerName() {
BaseCommand bc1 = new BaseCommand();
bc1.setLookupTopic();
assertFalse(bc1.getLookupTopic().hasAdvertisedListenerName());
try {
bc1.setLookupTopic().setAdvertisedListenerName(null);
fail();
} catch (NullPointerException e) {
// expected
}
BaseCommand bc2 = new BaseCommand();
bc2.setLookupTopic().setAdvertisedListenerName("");
assertTrue(bc2.getLookupTopic().hasAdvertisedListenerName());
} |
It will return true if the field is set. That is irrespective of the specific value that was set. |
Fixes #14304 ### Modifications - [ServerCnx] check for blank advertised listener name - [ServerCnx] improved logging
@BewareMyPower please cherry-pick this fix to 2.9, thanks. |
done. |
Fixes apache#14304 ### Modifications - [ServerCnx] check for blank advertised listener name - [ServerCnx] improved logging
Describe the bug
Some of the language bindings supply an empty string for the
advertisedListenerName
field ofCommandLookupTopic
(e.g. Java vs Golang). This confuses the broker, who then fails to apply the default advertised listener for the given server port. This, in turn, leads to an incorrect topic lookup response and a subsequent connection failure.For background, see [PIP 95] Smart Listener Selection with Multiple Bind Addresses.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expect the binding-specific advertised listener to be automatically applied to lookup request.
Proposed Solution
Enhance the broker to check for an empty string in the
advertisedListenerName
field. (code)The text was updated successfully, but these errors were encountered: