Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/3233#discussion_r23414288
--- Diff:
core/src/main/scala/org/apache/spark/executor/ExecutorURLClassLoader.scala ---
@@ -32,36 +35,40 @@ private[spark] trait MutableURLClassLoader extends
ClassLoader {
}
private[spark] class ChildExecutorURLClassLoader(urls: Array[URL], parent:
ClassLoader)
- extends MutableURLClassLoader {
-
- private object userClassLoader extends URLClassLoader(urls, null){
- override def addURL(url: URL) {
- super.addURL(url)
- }
- override def findClass(name: String): Class[_] = {
- super.findClass(name)
- }
- }
+ extends URLClassLoader(urls, null) with MutableURLClassLoader {
private val parentClassLoader = new ParentClassLoader(parent)
- override def findClass(name: String): Class[_] = {
+ override def loadClass(name: String, resolve: Boolean): Class[_] = {
try {
- userClassLoader.findClass(name)
--- End diff --
BTW, based on your comment (the link to the IBM article) on the other PR,
it seems it would be safer to make this method synchronized just to be safe.
I'd be surprised if any code in Spark would trigger a deadlock (it would take
some really sketchy code in a class's static initializer to trigger that), but
better to be safe.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]