Skip to content

Commit a2ef13a

Browse files
author
Marcelo Vanzin
committed
[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: Marcelo Vanzin <[email protected]>
1 parent 801fb79 commit a2ef13a

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
@@ -1813,7 +1813,7 @@ private[spark] object Utils extends Logging {
18131813
.invoke(process, timeoutMs.asInstanceOf[java.lang.Long], TimeUnit.MILLISECONDS)
18141814
.asInstanceOf[Boolean]
18151815
} catch {
1816-
case _: NoSuchMethodError =>
1816+
case _: NoSuchMethodException =>
18171817
// Otherwise implement it manually
18181818
var terminated = false
18191819
val startTime = System.currentTimeMillis

0 commit comments

Comments
 (0)