-
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
[Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler #15415
[Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler #15415
Conversation
@lhotari:Thanks for your contribution. For this PR, do we need to update docs? |
@lhotari:Thanks for providing doc info! |
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.
After this patch, addr.getAddress()
will return null
, but I can't find a place to do that.
LGTM
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.
Good catch
…pache#15415) * [Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler * Use existing code pattern for creating address (cherry picked from commit 7373a51)
…pache#15415) * [Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler * Use existing code pattern for creating address (cherry picked from commit 7373a51)
…pache#15415) * [Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler * Use existing code pattern for creating address (cherry picked from commit 7373a51)
LGTM. |
…pache#15415) * [Proxy] Remove unnecessary blocking DNS lookup in LookupProxyHandler * Use existing code pattern for creating address (cherry picked from commit 7373a51) (cherry picked from commit 85f0767)
Motivation
new InetSocketAddress(brokerURI.getHost(), brokerURI.getPort())
does a blocking DNS lookup. This should be avoided since Pulsar's ConnectionPool uses Netty's non-blocking DNS lookup. Unresolved addresses are expected as input to ConnectionPool.Modifications
replace
new InetSocketAddress
withInetSocketAddress.createUnresolved
by using existing helper method to create theInetSocketAddress
instance