diff options
author | Jacek Lewandowski <lewandowski.jacek@gmail.com> | 2015-02-05 12:00:04 -0800 |
---|---|---|
committer | Patrick Wendell <patrick@databricks.com> | 2015-02-05 12:00:04 -0800 |
commit | fba2dc663a644cfe76a744b5cace93e9d6646a25 (patch) | |
tree | b0b99b3f4cc181d30559a52a914f89461072f58d /core | |
parent | de112a2096a2b84ce2cac112f12b50b5068d6c35 (diff) | |
download | spark-fba2dc663a644cfe76a744b5cace93e9d6646a25.tar.gz spark-fba2dc663a644cfe76a744b5cace93e9d6646a25.tar.bz2 spark-fba2dc663a644cfe76a744b5cace93e9d6646a25.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.scala | 2 |
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() |