Skip to content

Commit

Permalink
Fix the race condition in StreamExecution.processAllAvailable again
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Apr 21, 2016
1 parent 3a21e8d commit eddf9fd
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ class StreamExecution(
// method. See SPARK-14131.
//
// Check to see what new data is available.
val newData = microBatchThread.runUninterruptibly {
uniqueSources.flatMap(s => s.getOffset.map(o => s -> o))
}
availableOffsets ++= newData

val hasNewData = awaitBatchLock.synchronized {
val newData = microBatchThread.runUninterruptibly {
uniqueSources.flatMap(s => s.getOffset.map(o => s -> o))
}
availableOffsets ++= newData

if (dataAvailable) {
true
} else {
Expand Down

0 comments on commit eddf9fd

Please sign in to comment.