-
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][client] Broker address resolution wrong if connect through a multi-dns names proxy #19597
[fix][client] Broker address resolution wrong if connect through a multi-dns names proxy #19597
Conversation
…lti-dns names proxy
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.
Great work @nicoloboschi! Thank you for fixing this!
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarChannelInitializer.java
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #19597 +/- ##
=============================================
+ Coverage 32.30% 62.10% +29.79%
- Complexity 7103 25775 +18672
=============================================
Files 1670 1844 +174
Lines 125944 135330 +9386
Branches 13727 14882 +1155
=============================================
+ Hits 40690 84043 +43353
+ Misses 79263 43551 -35712
- Partials 5991 7736 +1745
Flags with carried forward coverage won't be shown. Click here to find out 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.
Requesting changes since I think we need to get the hostname right for the setRemoteHostName
method.
Good point! I've fixed it PTAL |
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.
LGTM
…lti-dns names proxy (apache#19597) (cherry picked from commit e286339) (cherry picked from commit 14b070b) (cherry picked from commit 27f0449)
Motivation
Regression of #19327 (It only affects dev branches since no release have been done containing that pull)
in the client, to understand if is connected through a proxy, it checks the logical address vs the physical one, if they're different it supposes it has to target that specific broker passing through the proxy.
In the above pull request, the comparison logic is changed and the logical address is compared to ONE of the resolved dns names. in case of multiple dns names of the proxy, it might happens that the first resolved dns name doesn't match with the logical proxy address and therefore it's considered to be a broker dns name.
This leads to the proxy to recursive send connections to itself.
These are some logs extracted:
Modifications
Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete