Skip to content

Commit 702178d

Browse files
Marcelo Vanzinsrowen
authored andcommitted
[SPARK-16385][CORE] Catch correct exception when calling method via reflection.
Using "Method.invoke" causes an exception to be thrown, not an error, so Utils.waitForProcess() was always throwing an exception when run on Java 7. Author: Marcelo Vanzin <[email protected]> Closes #14056 from vanzin/SPARK-16385. (cherry picked from commit 59f9c1b) Signed-off-by: Sean Owen <[email protected]>
1 parent bb92788 commit 702178d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ private[spark] object Utils extends Logging {
17731773
.invoke(process, timeoutMs.asInstanceOf[java.lang.Long], TimeUnit.MILLISECONDS)
17741774
.asInstanceOf[Boolean]
17751775
} catch {
1776-
case _: NoSuchMethodError =>
1776+
case _: NoSuchMethodException =>
17771777
// Otherwise implement it manually
17781778
var terminated = false
17791779
val startTime = System.currentTimeMillis

0 commit comments

Comments
 (0)