dongjoon-hyun commented on a change in pull request #32983:
URL: https://github.com/apache/spark/pull/32983#discussion_r654890336



##########
File path: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
##########
@@ -401,7 +401,13 @@ private[spark] class Client(
     if (force || !compareFs(srcFs, destFs) || "file".equals(srcFs.getScheme)) {
       destPath = new Path(destDir, destName.getOrElse(srcPath.getName()))
       logInfo(s"Uploading resource $srcPath -> $destPath")
-      FileUtil.copy(srcFs, srcPath, destFs, destPath, false, hadoopConf)
+      try {
+        FileUtil.copy(srcFs, srcPath, destFs, destPath, false, hadoopConf)
+      } catch {
+        // HADOOP-16878 changes the behavior to throw exceptions when src 
equals to dest
+        case e: PathOperationException
+            if force && 
srcFs.makeQualified(srcPath).equals(destFs.makeQualified(destPath)) =>

Review comment:
       BTW, I don't want to introduce any behavior change here. As @HyukjinKwon 
's pointed out, there might be a corner case in some cases 
(https://github.com/apache/spark/pull/32983#issuecomment-864492077).
   > This doesn't seems to handle the case where the nameservice of both source 
& target filesystem is same, but they point to different clusters. So, it gives 
a false alarm in that case.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to