Skip to content
Snippets Groups Projects
Commit 59f9c1bd authored by Marcelo Vanzin's avatar Marcelo Vanzin
Browse files

[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 <vanzin@cloudera.com>

Closes #14056 from vanzin/SPARK-16385.
parent 4db63fd2
No related branches found
No related tags found
No related merge requests found
......@@ -1813,7 +1813,7 @@ private[spark] object Utils extends Logging {
.invoke(process, timeoutMs.asInstanceOf[java.lang.Long], TimeUnit.MILLISECONDS)
.asInstanceOf[Boolean]
} catch {
case _: NoSuchMethodError =>
case _: NoSuchMethodException =>
// Otherwise implement it manually
var terminated = false
val startTime = System.currentTimeMillis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment