-
- Downloads
[SPARK-10224] [STREAMING] Fix the issue that blockIntervalTimer won't call...
[SPARK-10224] [STREAMING] Fix the issue that blockIntervalTimer won't call updateCurrentBuffer when stopping `blockIntervalTimer.stop(interruptTimer = false)` doesn't guarantee calling `updateCurrentBuffer`. So it's possible that `blockIntervalTimer` will exit when `updateCurrentBuffer` is not empty. Then the data in `currentBuffer` will be lost. To reproduce it, you can add `Thread.sleep(200)` in this line (https://github.com/apache/spark/blob/69c9c177160e32a2fbc9b36ecc52156077fca6fc/streaming/src/main/scala/org/apache/spark/streaming/util/RecurringTimer.scala#L100) and run `StreamingContexSuite`. I cannot write a unit test to reproduce it because I cannot find an approach to force `RecurringTimer` suspend at this line for a few milliseconds. There was a failure in Jenkins here: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/41455/console This PR updates RecurringTimer to make sure `stop(interruptTimer = false)` will call `callback` at least once after the `stop` method is called. Author: zsxwing <zsxwing@gmail.com> Closes #8417 from zsxwing/SPARK-10224.
Showing
- streaming/src/main/scala/org/apache/spark/streaming/util/RecurringTimer.scala 13 additions, 6 deletions...cala/org/apache/spark/streaming/util/RecurringTimer.scala
- streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala 4 additions, 3 deletions...apache/spark/streaming/receiver/BlockGeneratorSuite.scala
- streaming/src/test/scala/org/apache/spark/streaming/util/RecurringTimerSuite.scala 83 additions, 0 deletions...org/apache/spark/streaming/util/RecurringTimerSuite.scala
Please register or sign in to comment