aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJacek Lewandowski <lewandowski.jacek@gmail.com>2015-02-05 12:00:04 -0800
committerPatrick Wendell <patrick@databricks.com>2015-02-05 12:21:40 -0800
commit081ac69f3dfc095f5e01248536f3ed2b83d5ebe2 (patch)
tree9a37fdd1ebd0aa0387bcb8b41391998e98d437f2 /core
parent34147549a7ad188e5eae8d818d36ca0fe882c16f (diff)
downloadspark-081ac69f3dfc095f5e01248536f3ed2b83d5ebe2.tar.gz
spark-081ac69f3dfc095f5e01248536f3ed2b83d5ebe2.tar.bz2
spark-081ac69f3dfc095f5e01248536f3ed2b83d5ebe2.zip
SPARK-5548: Fixed a race condition in AkkaUtilsSuite
`Await.result` and `selection.resolveOne` runs the same timeout simultaneously. When `Await.result` timeout is reached first, then `TimeoutException` is thrown. On the other hand, when `selection.resolveOne` timeout is reached first, `ActorNotFoundException` is thrown. This is an obvious race condition and the easiest way to fix it is to increase the timeout of one method to make sure the code fails on the other method first. Author: Jacek Lewandowski <lewandowski.jacek@gmail.com> Closes #4343 from jacek-lewandowski/SPARK-5548-1.3 and squashes the following commits: b9ba47e [Jacek Lewandowski] SPARK-5548: Fixed a race condition in AkkaUtilsSuite
Diffstat (limited to 'core')
-rw-r--r--core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala
index 39e5d367d6..2cc5817758 100644
--- a/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala
@@ -371,7 +371,7 @@ class AkkaUtilsSuite extends FunSuite with LocalSparkContext with ResetSystemPro
AkkaUtils.address(AkkaUtils.protocol(slaveSystem), "spark", "localhost", boundPort, "MapOutputTracker"))
val timeout = AkkaUtils.lookupTimeout(conf)
intercept[TimeoutException] {
- slaveTracker.trackerActor = Await.result(selection.resolveOne(timeout), timeout)
+ slaveTracker.trackerActor = Await.result(selection.resolveOne(timeout * 2), timeout)
}
actorSystem.shutdown()