-
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] Can't connecte to non-persist topic when enable broker client tls #22991
Conversation
@shibd I need to confirm two questions: Do you know if you only enabled TLS? Usually, the |
oh, I understand this sentence. Yes, your are right. But, in current implementation. If enable BrokerClientTls, will use pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java Lines 1679 to 1681 in 4e535cb
then, in here. It will use pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java Lines 1482 to 1484 in 2662c11
and will create a new BinaryProtoLookupService with incorrect param: (noTlsBrokerUrl, and enableTls) and then, when create a new connection, into this logic, resulting in an error. pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java Lines 420 to 428 in 6b29382
|
So, I think the root cause is we not should use internal method for PulsarClient on here. pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java Lines 1482 to 1483 in 2662c11
I think this fix can make sure use same connection type with In future, maybe we need refactor this logic. /cc @poorbarcode |
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.
Thanks for your explanation! LGTM
...ar-broker/src/test/java/org/apache/pulsar/client/api/TokenExpirationProduceConsumerTest.java
Show resolved
Hide resolved
So far, the method
There is retry mechanism on the client-side when calling |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22991 +/- ##
============================================
- Coverage 73.57% 73.45% -0.12%
- Complexity 32624 33289 +665
============================================
Files 1877 1908 +31
Lines 139502 143001 +3499
Branches 15299 15589 +290
============================================
+ Hits 102638 105041 +2403
- Misses 28908 29921 +1013
- Partials 7956 8039 +83
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…client tls (apache#22991) (cherry picked from commit deb26f7) (cherry picked from commit 998bd90)
…client tls (apache#22991) (cherry picked from commit deb26f7) (cherry picked from commit 998bd90)
Motivation
After #22838, if to connect a non-persist topic when broker enable client TLS, will failed.
The reason is lookup always uses
brokerUrl
instead ofbrokerTlsUrl
.Modifications
Verifying this change
testNonPersistentTopic
to cover it.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: