diff options
author | Sean Owen <sowen@cloudera.com> | 2016-07-01 09:22:27 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-07-01 09:22:27 +0100 |
commit | 2075bf8ef6035fd7606bcf20dc2cd7d7b9cda446 (patch) | |
tree | 1ab93f1d9992f86a303ff8f90add8e7b123007ea /core/src/test/scala/org | |
parent | fbfd0ab9d70f557c38c7bb8e704475bf19adaf02 (diff) | |
download | spark-2075bf8ef6035fd7606bcf20dc2cd7d7b9cda446.tar.gz spark-2075bf8ef6035fd7606bcf20dc2cd7d7b9cda446.tar.bz2 spark-2075bf8ef6035fd7606bcf20dc2cd7d7b9cda446.zip |
[SPARK-16182][CORE] Utils.scala -- terminateProcess() should call Process.destroyForcibly() if and only if Process.destroy() fails
## What changes were proposed in this pull request?
Utils.terminateProcess should `destroy()` first and only fall back to `destroyForcibly()` if it fails. It's kind of bad that we're force-killing executors -- and only in Java 8. See JIRA for an example of the impact: no shutdown
While here: `Utils.waitForProcess` should use the Java 8 method if available instead of a custom implementation.
## How was this patch tested?
Existing tests, which cover the force-kill case, and Amplab tests, which will cover both Java 7 and Java 8 eventually. However I tested locally on Java 8 and the PR builder will try Java 7 here.
Author: Sean Owen <sowen@cloudera.com>
Closes #13973 from srowen/SPARK-16182.
Diffstat (limited to 'core/src/test/scala/org')
-rw-r--r-- | core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala index df279b5a37..f5d0fb00b7 100644 --- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala @@ -863,7 +863,7 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { assert(terminated.isDefined) Utils.waitForProcess(process, 5000) val duration = System.currentTimeMillis() - start - assert(duration < 5000) + assert(duration < 6000) // add a little extra time to allow a force kill to finish assert(!pidExists(pid)) } finally { signal(pid, "SIGKILL") |