LIVY-866: Optimize Yarn GetApplications Query to prevent additional load on Yarn and Livy - #533
Open
nileshrathi345 wants to merge 2 commits into
Open
LIVY-866: Optimize Yarn GetApplications Query to prevent additional load on Yarn and Livy#533nileshrathi345 wants to merge 2 commits into
nileshrathi345 wants to merge 2 commits into
Conversation
Contributor
Author
|
@gyogal, @ArnavBalyan and @roczei could you please take a look when possible and review |
roczei
reviewed
Jul 27, 2026
nileshrathi345
force-pushed
the
master_LIVY-866
branch
from
July 28, 2026 04:25
1e66ca7 to
929489d
Compare
…oad on Yarn and Livy LIVY-866: Optimize Yarn GetApplications Query to prevent additional load on Yarn and Livy
nileshrathi345
force-pushed
the
master_LIVY-866
branch
from
July 28, 2026 04:50
929489d to
916f964
Compare
roczei
reviewed
Jul 28, 2026
…oad on Yarn and Livy
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #533 +/- ##
============================================
+ Coverage 68.38% 68.67% +0.29%
- Complexity 1199 1214 +15
============================================
Files 106 106
Lines 6711 6793 +82
Branches 831 839 +8
============================================
+ Hits 4589 4665 +76
- Misses 1657 1661 +4
- Partials 465 467 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Problem
Livy was calling YarnClient.getApplications(SPARK), which asks the ResourceManager for all Spark applications and then filters client-side by application tag. On clusters with many Spark apps, this produces large RM responses, adds unnecessary load on YARN, and can contribute to RM memory pressure (especially during session startup polling and leaked-app GC).
Solution
Use a tag-filtered GetApplicationsRequest so the RM returns only matching applications:
Jira: https://issues.apache.org/jira/browse/LIVY-866
How was this patch tested?
Updated and ran SparkYarnAppSpec, including:
Was this patch authored or co-authored using generative AI tooling?
Yes, this was co-authored using Cursor to help understanding of solution for leakedAppsGCThread