@@ -560,10 +560,15 @@ private[spark] class Executor(
560
560
override def run (): Unit = {
561
561
562
562
// Classloader isolation
563
- val isolatedSession = taskDescription.artifacts.state match {
563
+ val ( isolatedSession, files, jars, archives) = taskDescription.artifacts.state match {
564
564
case Some (jobArtifactState) =>
565
- isolatedSessionCache.get(jobArtifactState.uuid, () => newSessionState(jobArtifactState))
566
- case _ => defaultSessionState
565
+ (isolatedSessionCache.get(jobArtifactState.uuid, () => newSessionState(jobArtifactState)),
566
+ taskDescription.artifacts.files ++ initialUserFiles,
567
+ taskDescription.artifacts.jars ++ initialUserJars,
568
+ taskDescription.artifacts.archives ++ initialUserArchives)
569
+ case _ =>
570
+ (defaultSessionState, taskDescription.artifacts.files, taskDescription.artifacts.jars,
571
+ taskDescription.artifacts.archives)
567
572
}
568
573
569
574
setMDCForTask(taskName, mdcProperties)
@@ -589,11 +594,8 @@ private[spark] class Executor(
589
594
// requires access to properties contained within (e.g. for access control).
590
595
Executor .taskDeserializationProps.set(taskDescription.properties)
591
596
592
- updateDependencies(
593
- taskDescription.artifacts.files,
594
- taskDescription.artifacts.jars,
595
- taskDescription.artifacts.archives,
596
- isolatedSession)
597
+ updateDependencies(files, jars, archives, isolatedSession)
598
+
597
599
// Always reset the thread class loader to ensure if any updates, all threads (not only
598
600
// the thread that updated the dependencies) can update to the new class loader.
599
601
Thread .currentThread.setContextClassLoader(isolatedSession.replClassLoader)
0 commit comments