You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2015/02/05 21:00:11 UTC

spark git commit: SPARK-5548: Fixed a race condition in AkkaUtilsSuite

Repository: spark
Updated Branches:
  refs/heads/branch-1.3 de112a209 -> fba2dc663


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 <le...@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


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

Branch: refs/heads/branch-1.3
Commit: fba2dc663a644cfe76a744b5cace93e9d6646a25
Parents: de112a2
Author: Jacek Lewandowski <le...@gmail.com>
Authored: Thu Feb 5 12:00:04 2015 -0800
Committer: Patrick Wendell <pa...@databricks.com>
Committed: Thu Feb 5 12:00:04 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/fba2dc66/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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org