Repository: spark
Updated Branches:
  refs/heads/master 34147549a -> 081ac69f3


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 <[email protected]>

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


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/081ac69f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/081ac69f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/081ac69f

Branch: refs/heads/master
Commit: 081ac69f3dfc095f5e01248536f3ed2b83d5ebe2
Parents: 3414754
Author: Jacek Lewandowski <[email protected]>
Authored: Thu Feb 5 12:00:04 2015 -0800
Committer: Patrick Wendell <[email protected]>
Committed: Thu Feb 5 12:21:40 2015 -0800

----------------------------------------------------------------------
 core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/081ac69f/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala
----------------------------------------------------------------------
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 39e5d36..2cc5817 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()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to