[improve][client] Add a way to configure which DNS use#21227
Conversation
b8d2756 to
48b6c0c
Compare
|
Rebased on synced fork |
|
Last review issue has been addressed |
|
/pulsarbot rerun-failure-checks |
|
Fails org.apache.pulsar.common.nar.NarUnpackerTest.shouldExtractFilesOnceInDifferentProcess |
|
@diegosalvi Could you rebase your codebase? |
|
@diegosalvi Could you please provide more context of the use case? The reason why I'm asking is that I don't currently see why the Pulsar client should have a different DNS server configured apart from the rest of the application and the OS where the app is running. |
Yes, it's flaky. reported as #21291 |
|
@lhotari currently we are using Pulsar in a production environment. In such environment we have need to use different dns for the server machine (configured by standard resolvconf et simillia) and java processes. For many java cases we directly do lookups on dns with different libraries (so we don't use java discovered dnses) but we can't do the same for Pulsar. |
1b57ce5 to
9e2bc1a
Compare
|
@nodece Rebased |
@diegosalvi for future documentation purposes, would you be able to share more details and a common reference? Is it a split DNS setup where you have an internal DNS separate from an external DNS ? Would you configure the Pulsar client to use the internal DNS server? |
|
@lhotari Yes, something along the line. DNS for Pulsar are "internal" "applicative" ones leaving the host machine with a different set of dns (via resolv.conf etc etc) and other "external" DNS queried directly by java processes when in need to resolve "public" names. |
|
Still fails for NarUnpackerTest |
@diegosalvi This flaky NarUnpackerTest has been fixed. You can get the fix to this PR by rebasing on or merging origin/master. |
9e2bc1a to
53f5241
Compare
|
Rebased again |
Codecov Report
@@ Coverage Diff @@
## master #21227 +/- ##
=============================================
+ Coverage 36.84% 73.22% +36.37%
- Complexity 12229 32529 +20300
=============================================
Files 1699 1888 +189
Lines 130559 140257 +9698
Branches 14264 15445 +1181
=============================================
+ Hits 48106 102703 +54597
+ Misses 76121 29457 -46664
- Partials 6332 8097 +1765
Flags with carried forward coverage won't be shown. Click here to find out more.
|
nodece
left a comment
There was a problem hiding this comment.
This PR adds a public method to ClientBuilder.java, I'm not sure if PIP is required.
LGTM
There was a problem hiding this comment.
I agree with this proposal and since it adds a new public API, I suppose a PIP is required to create, while it should be very straight forward and we can quickly reach a consensus.
@diegosalvi what do you think? You can refer to this page for sending a PIP.
|
Pending for merging as PIP-305 #21352 merged. |
This closes #21226
Motivation
Currently is not possibile to configure one or more dns servers that will be used by the client to resolve hostnames.
Modifications
Added an optional configuration ClientConfigurationData.dnsServerAddresses to allow to configure custom DNSs. It not provided or empty will default to the existing behaviour.
Handled the new conf in ConnectionPool.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: