Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-14579][SQL]Fix the race condition in StreamExecution.processAllAvailable again #12582

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ class MemorySinkSuite extends StreamTest with SharedSQLContext {
import testImplicits._

test("registering as a table") {
testRegisterAsTable()
}

ignore("stress test") {
// Ignore the stress test as it takes several minutes to run
(0 until 1000).foreach(_ => testRegisterAsTable())
}

private def testRegisterAsTable(): Unit = {
val input = MemoryStream[Int]
val query = input.toDF().write
.format("memory")
Expand Down