Skip to content

Commit 961c284

Browse files
committed
Roll back changes that were added to get the regression test to fail
1 parent 7ee2261 commit 961c284

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader
8888
connection.setConnectTimeout(httpUrlConnectionTimeoutMillis)
8989
connection.setReadTimeout(httpUrlConnectionTimeoutMillis)
9090
}
91-
connection.getInputStream
91+
connection.connect()
92+
if (connection.getResponseCode != 200) {
93+
connection.disconnect()
94+
throw new ClassNotFoundException(s"Class file not found at URL $url")
95+
} else {
96+
connection.getInputStream
97+
}
9298
}
9399

94100
private def getClassFileInputStreamFromFileSystem(pathInDirectory: String): InputStream = {
@@ -125,7 +131,7 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader
125131
} finally {
126132
if (inputStream != null) {
127133
try {
128-
//inputStream.close()
134+
inputStream.close()
129135
} catch {
130136
case e: Exception =>
131137
logError("Exception while closing inputStream", e)

0 commit comments

Comments
 (0)