[LIVY-1071] Add driver.address.use-hostname RSC config flag - #544
[LIVY-1071] Add driver.address.use-hostname RSC config flag#544soumyadeeplogin wants to merge 3 commits into
Conversation
|
Filed https://issues.apache.org/jira/browse/LIVY-1071 for this change. |
Adds an opt-in RSCConf key, driver.address.use-hostname (default false), that makes ContextLauncher resolve the RSC driver's address from the hostname reported in RemoteDriverAddress instead of the socket's IP. Existing IP-based behavior is unchanged when the flag is left at its default. Useful for Kubernetes + service-mesh (Istio) deployments where pod IPs are not stable/routable but hostnames are. Authored-by: Venugopal Allenki <vallenki@salesforce.com> Co-authored-by: Soumyadeep Roy <soumyadeep.roy@salesforce.com>
e3796c8 to
7341e2e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #544 +/- ##
============================================
+ Coverage 68.68% 68.82% +0.14%
- Complexity 1218 1219 +1
============================================
Files 106 107 +1
Lines 6815 6875 +60
Branches 836 839 +3
============================================
+ Hits 4681 4732 +51
- Misses 1666 1675 +9
Partials 468 468 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the PR! The change looks good overall. I have a few minor follow-ups, could you please address them when you have a chance?
Please add livy.rsc.driver.address.use-hostname in conf/livy.conf.template, near the other livy.rsc.jars setting.
Please add unit tests for the new flag. Two simple tests in TestSparkClient would be enough:
For both tests, set RPC_SERVER_ADDRESS to something like spark-driver.default.svc.cluster.local, then check ContextInfo.remoteAddress.
Please add this section to the PR description as required by the Livy PR template: Was this patch authored or co-authored using generative AI tooling?(If yes, include 'Generated-by: ' followed by the tool name and version. If no, write 'No'.) |
Codecov flagged the DRIVER_ADDRESS_USE_HOSTNAME branch in ContextLauncher as untested when CI ran on this PR. RegistrationHandler.handle() could not be unit-tested directly since it depends on a live Netty ChannelHandlerContext, so the branch logic is extracted into a new package-private static method, ContextLauncher.resolveDriverAddress, which is directly testable. Behavior is unchanged.
Per review feedback on apache#544, document the new livy.rsc.driver.address.use-hostname flag next to the other livy.rsc.* settings so operators can discover it without reading RSCConf source.
|
Thanks for the review, @roczei! Pushed updates addressing all three points: 1. Documentation — Added 2. Unit test — Added Instead, I extracted the branch logic out of 3. AI tooling disclosure — Added the required section to the PR description. |
|
Thanks for addressing the feedbacks, looks good from my side! |
|
Thanks @roczei for approving the PR. Could you please approve the workflows as well when you get a chance? |
Currently I'm neither a Livy PMC member nor a committer, so I don't have the necessary permissions to run the CI. Probably this is the actual configuration: |
What changes were proposed in this pull request?
Adds an opt-in
RSCConfkey,driver.address.use-hostname(defaultfalse), that makesContextLauncherresolve the RSC driver's address from the hostname reported inRemoteDriverAddressinstead of the socket's IP. Existing IP-based behavior is unchanged when the flag is left at its default.This is useful for Kubernetes + service-mesh (Istio) deployments where pod IPs are not stable/routable but hostnames are.
Originally authored by Venugopal Allenki, extracted and rebased onto current
masterfor upstreaming.How was this patch tested?
Manually verified in a Kubernetes + Istio deployment with the flag enabled and disabled.
Added
TestContextLauncherwith unit tests covering both resolution paths (default socket-IP path, and hostname path when the flag is enabled) against a newContextLauncher.resolveDriverAddressmethod extracted fromRegistrationHandler.handle()for direct testability, since the handler itself is a private inner class only exercisable via a full RPC handshake. Also documented the new flag inconf/livy.conf.template.Was this patch authored or co-authored using generative AI tooling?
Yes. Generated-by: Claude Code (Sonnet 5, Anthropic), used to scan/plan the extraction of local UIP patches for upstreaming and to draft/iterate on the code and tests in this PR under human review. Please refer to the ASF Generative Tooling Guidance for details.
Note on JIRA
Filed as LIVY-1071.