aboutsummaryrefslogtreecommitdiff
path: root/project/SparkBuild.scala
diff options
context:
space:
mode:
authorAndrew Or <andrewor14@gmail.com>2014-04-24 20:18:15 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-04-24 20:18:15 -0700
commitee6f7e22a449837864072e3cd2b6696005f134f1 (patch)
tree84e723f5443a5056bb691e29393962570ada7dfa /project/SparkBuild.scala
parent80429f3e2ab786d103297652922c3d8da3cf5a01 (diff)
downloadspark-ee6f7e22a449837864072e3cd2b6696005f134f1.tar.gz
spark-ee6f7e22a449837864072e3cd2b6696005f134f1.tar.bz2
spark-ee6f7e22a449837864072e3cd2b6696005f134f1.zip
[SPARK-1615] Synchronize accesses to the LiveListenerBus' event queue
Original poster is @zsxwing, who reported this bug in #516. Much of SparkListenerSuite relies on LiveListenerBus's `waitUntilEmpty()` method. As the name suggests, this waits until the event queue is empty. However, the following race condition could happen: (1) We dequeue an event (2) The queue is empty, we return true (even though the event has not been processed) (3) The test asserts something assuming that all listeners have finished executing (and fails) (4) The listeners receive and process the event This PR makes (1) and (4) atomic by synchronizing around it. To do that, however, we must avoid using `eventQueue.take`, which is blocking and will cause a deadlock if we synchronize around it. As a workaround, we use the non-blocking `eventQueue.poll` + a semaphore to provide the same semantics. This has been a possible race condition for a long time, but for some reason we've never run into it. Author: Andrew Or <andrewor14@gmail.com> Closes #544 from andrewor14/stage-info-test-fix and squashes the following commits: 3cbe40c [Andrew Or] Merge github.com:apache/spark into stage-info-test-fix 56dbbcb [Andrew Or] Check if event is actually added before releasing semaphore eb486ae [Andrew Or] Synchronize accesses to the LiveListenerBus' event queue
Diffstat (limited to 'project/SparkBuild.scala')
0 files changed, 0 insertions, 0 deletions