Skip to content
Snippets Groups Projects
Commit 9f0a6e18 authored by Tobias Schlatter's avatar Tobias Schlatter Committed by Patrick Wendell
Browse files

[SPARK-5353] Log failures in REPL class loading

Author: Tobias Schlatter <tobias@meisch.ch>

Closes #4130 from gzm0/log-repl-loading and squashes the following commits:

4fa0582 [Tobias Schlatter] Log failures in REPL class loading
parent a15f6e31
No related branches found
No related tags found
No related merge requests found
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
package org.apache.spark.repl package org.apache.spark.repl
import java.io.{ByteArrayOutputStream, InputStream} import java.io.{ByteArrayOutputStream, InputStream, FileNotFoundException}
import java.net.{URI, URL, URLEncoder} import java.net.{URI, URL, URLEncoder}
import java.util.concurrent.{Executors, ExecutorService} import java.util.concurrent.{Executors, ExecutorService}
import org.apache.hadoop.fs.{FileSystem, Path} import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.spark.{SparkConf, SparkEnv} import org.apache.spark.{SparkConf, SparkEnv, Logging}
import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.deploy.SparkHadoopUtil
import org.apache.spark.util.Utils import org.apache.spark.util.Utils
import org.apache.spark.util.ParentClassLoader import org.apache.spark.util.ParentClassLoader
...@@ -37,7 +37,7 @@ import com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.Opcodes._ ...@@ -37,7 +37,7 @@ import com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.Opcodes._
* Allows the user to specify if user class path should be first * Allows the user to specify if user class path should be first
*/ */
class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader, class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader,
userClassPathFirst: Boolean) extends ClassLoader { userClassPathFirst: Boolean) extends ClassLoader with Logging {
val uri = new URI(classUri) val uri = new URI(classUri)
val directory = uri.getPath val directory = uri.getPath
...@@ -91,7 +91,14 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader ...@@ -91,7 +91,14 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader
inputStream.close() inputStream.close()
Some(defineClass(name, bytes, 0, bytes.length)) Some(defineClass(name, bytes, 0, bytes.length))
} catch { } catch {
case e: Exception => None case e: FileNotFoundException =>
// We did not find the class
logDebug(s"Did not load class $name from REPL class server at $uri", e)
None
case e: Exception =>
// Something bad happened while checking if the class exists
logError(s"Failed to check existence of class $name on REPL class server at $uri", e)
None
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment