-
Notifications
You must be signed in to change notification settings - Fork 345
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
[CDAP-20922] Reuse the Spark ClassLoader in app-fabric #15483
base: develop
Are you sure you want to change the base?
Conversation
chtyim
commented
Dec 4, 2023
- For non local spark program execution purposes, we don’t need to isolate the Spark classloader, since there is no creation of the SparkContext object.
// Never needs to rewrite yarn client in CDAP master, which is the only place using | ||
// distributed program runner. Also wrap the classloader so that it can't be closed. | ||
distributedRunnerClassLoader = new ClassLoader(createClassLoader(true, false, false)) {}; | ||
return distributedRunnerClassLoader; |
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.
Instead of returning distributedRunnerClassLoader
and incurring another expensive read from a volatile variable, can we write the new classloader to our existing local variable classLoader
, assign it to distributedRunnerClassLoader
, then return the local variable?
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.
That's not really expensive and it is just have it hit once due to the singleton. Just don't wanna clutter the code too much
9ddb843
to
a4ecc5d
Compare
- For non local spark program execution purposes, we don’t need to isolate the Spark classloader, since there is no creation of the SparkContext object.
a4ecc5d
to
7e9abd0
Compare
} | ||
try { | ||
// Never needs to rewrite yarn client in CDAP master, which is the only place using | ||
// distributed program runner. Also wrap the classloader so that it can't be closed. |
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.
Wrapping it will also make it difficult for task workers to close the class loader. So we won't be able to solve the memory increases in task workers until we have a way to re-use this class loader in task workers also.