diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2016-07-05 16:55:22 -0700 |
---|---|---|
committer | Marcelo Vanzin <vanzin@cloudera.com> | 2016-07-05 16:55:22 -0700 |
commit | 59f9c1bd1adfea7069e769fb68351c228c37c8fc (patch) | |
tree | 941ae34092f4da2658ffba12269d3c6ae4d9c482 /core/src | |
parent | 4db63fd2b430b0902ce0e50f526b1c2e2a5c6497 (diff) | |
download | spark-59f9c1bd1adfea7069e769fb68351c228c37c8fc.tar.gz spark-59f9c1bd1adfea7069e769fb68351c228c37c8fc.tar.bz2 spark-59f9c1bd1adfea7069e769fb68351c228c37c8fc.zip |
[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.
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/scala/org/apache/spark/util/Utils.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 0c23f3cd35..156cf1748b 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -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 |