Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ class ExecutorClassLoader(
parent: ClassLoader,
userClassPathFirst: Boolean) extends ClassLoader(null) with Logging {
val uri = new URI(classUri)
val directory = uri.getPath

val parentLoader = new ParentClassLoader(parent)

// Allows HTTP connect and read timeouts to be controlled for testing / debugging purposes
private[repl] var httpUrlConnectionTimeoutMillis: Int = -1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is unused


private val fetchFn: (String) => InputStream = uri.getScheme() match {
case "spark" => getClassFileInputStreamFromSparkRPC
case _ =>
Expand Down Expand Up @@ -160,7 +155,7 @@ class ExecutorClassLoader(

private def getClassFileInputStreamFromFileSystem(fileSystem: FileSystem)(
pathInDirectory: String): InputStream = {
val path = new Path(directory, pathInDirectory)
val path = new Path(new Path(uri), pathInDirectory)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain a little more what inputs fail without this change?

Copy link
Author

@yellowflash yellowflash Aug 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hadoop Http filesystem require the paths to be fully qualified URLs.
It does path.toUri.toUrl which fails in our case because the Path is not fully qualified.
So the class loader doesn't work if the class uri is http://..../ I raised a PR on hadoop too,

apache/hadoop#3338
But this is a regression on spark, as it used to work with a very specific implementation for http based class servers and now since it uses the Filesystem api for everything and it doesn't work anymore.

try {
fileSystem.open(path)
} catch {
Expand Down