You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by harishreedharan <gi...@git.apache.org> on 2014/12/17 22:39:07 UTC

[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

GitHub user harishreedharan opened a pull request:

    https://github.com/apache/spark/pull/3726

    [SPARK-4790][STREAMING] Fix ReceivedBlockTrackerSuite waits for old file...

    ...s to get deleted before continuing.
    
    Since the deletes are happening asynchronously, the getFileStatus call might throw an exception in older HDFS
    versions, if the delete happens between the time listFiles is called on the directory and getFileStatus is called
    on the file in the getFileStatus method.
    
    This PR addresses this by adding an option to delete the files synchronously and then waiting for the deletion to
    complete before proceeding.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/harishreedharan/spark spark-4790

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/3726.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3726
    
----
commit af00fd145f05cb7bee2474ee37f366e1fd56912d
Author: Hari Shreedharan <hs...@apache.org>
Date:   2014-12-17T21:35:20Z

    [SPARK-4790][STREAMING] Fix ReceivedBlockTrackerSuite waits for old files to get deleted before continuing.
    
    Since the deletes are happening asynchronously, the getFileStatus call might throw an exception in older HDFS
    versions, if the delete happens between the time listFiles is called on the directory and getFileStatus is called
    on the file in the getFileStatus method.
    
    This PR addresses this by adding an option to delete the files synchronously and then waiting for the deletion to
    complete before proceeding.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67410842
  
      [Test build #24556 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24556/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `  class HiveThriftServer2Listener(val server: HiveServer2) extends SparkListener `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22020330
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/WriteAheadLogManager.scala ---
    @@ -146,10 +163,15 @@ private[streaming] class WriteAheadLogManager(
           logInfo(s"Cleared log files in $logDirectory older than $threshTime")
         }
         if (!executionContext.isShutdown) {
    -      Future { deleteFiles() }
    +      val f = Future { deleteFiles() }
    +      if (waitForCompletion) {
    +        import scala.concurrent.duration._
    +        Await.ready(f, 1 second)
    --- End diff --
    
    `1 second` may be not enough. Why not return Future to the user so that they can use it to wait by themselves?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68087155
  
      [Test build #24807 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24807/consoleFull) for   PR 3726 at commit [`3255f17`](https://github.com/apache/spark/commit/3255f1710d7ffbbbd2de4b098eb444885b2aad36).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68025072
  
     Eventually is pretty much trying a test in a loop and that encourages flakey tests - I am in general not a very big fan of using eventually. 
    The correct approach is to fix the non-determinism. Being able to detect that all files have been deleted has value - and gives easy debuggability. Being able to deterministically to know that all files are gone before proceeding does help debuggability.
    
    I don't really believe we are actually a accommodating  the test - we are really fixing the code to allow deterministic testing. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68077234
  
      [Test build #24791 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24791/consoleFull) for   PR 3726 at commit [`e4c83ec`](https://github.com/apache/spark/commit/e4c83eca17c660644216b6d8cc862f8b1654649c).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22267308
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala ---
    @@ -139,14 +139,22 @@ private[streaming] class ReceivedBlockTracker(
         getReceivedBlockQueue(streamId).toSeq
       }
     
    -  /** Clean up block information of old batches. */
    +  /** Clean up block information of old batches asynchronously. */
       def cleanupOldBatches(cleanupThreshTime: Time): Unit = synchronized {
    +    cleanupOldBatches(cleanupThreshTime, waitForCompletion = false)
    +  }
    +
    +  /**
    +   * Clean up block information of old batches. If waitForCompletion is true, this method
    +   * returns only after the files are cleaned up.
    +   */
    +  def cleanupOldBatches(cleanupThreshTime: Time, waitForCompletion: Boolean): Unit = synchronized {
    --- End diff --
    
    Hmm..I thought I pushed the commit that removed this one. Let me check. Anyway I agree we don't need both, will remove the other one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68087103
  
      [Test build #24806 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24806/consoleFull) for   PR 3726 at commit [`e4c83ec`](https://github.com/apache/spark/commit/e4c83eca17c660644216b6d8cc862f8b1654649c).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/3726


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68088934
  
      [Test build #24807 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24807/consoleFull) for   PR 3726 at commit [`3255f17`](https://github.com/apache/spark/commit/3255f1710d7ffbbbd2de4b098eb444885b2aad36).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22021111
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/WriteAheadLogManager.scala ---
    @@ -146,10 +163,15 @@ private[streaming] class WriteAheadLogManager(
           logInfo(s"Cleared log files in $logDirectory older than $threshTime")
         }
         if (!executionContext.isShutdown) {
    -      Future { deleteFiles() }
    +      val f = Future { deleteFiles() }
    +      if (waitForCompletion) {
    +        import scala.concurrent.duration._
    +        Await.ready(f, 1 second)
    --- End diff --
    
    I fixed it using `Future` in #3721. Could you take a look?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22264429
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/WriteAheadLogManager.scala ---
    @@ -124,8 +124,25 @@ private[streaming] class WriteAheadLogManager(
        * files, which is usually based on the local system time. So if there is coordination necessary
        * between the node calculating the threshTime (say, driver node), and the local system time
        * (say, worker node), the caller has to take account of possible time skew.
    +   *
    +   * This method deletes old log files asynchronously.
        */
       def cleanupOldLogs(threshTime: Long): Unit = {
    +    cleanupOldLogs(threshTime, waitForCompletion = false)
    +  }
    +
    +  /**
    +   * Delete the log files that are older than the threshold time.
    +   *
    +   * Its important to note that the threshold time is based on the time stamps used in the log
    +   * files, which is usually based on the local system time. So if there is coordination necessary
    +   * between the node calculating the threshTime (say, driver node), and the local system time
    +   * (say, worker node), the caller has to take account of possible time skew.
    +   *
    +   * If waitForCompletion is set to true, this method will return only after old logs have been
    +   * deleted. Else the files will be deleted asynchronously.
    +   */
    +  def cleanupOldLogs(threshTime: Long, waitForCompletion: Boolean): Unit = {
    --- End diff --
    
    Yep, sound good. I will update the PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68091769
  
      [Test build #24811 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24811/consoleFull) for   PR 3726 at commit [`3255f17`](https://github.com/apache/spark/commit/3255f1710d7ffbbbd2de4b098eb444885b2aad36).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67399854
  
      [Test build #24556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24556/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67420349
  
      [Test build #24560 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24560/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `  class HiveThriftServer2Listener(val server: HiveServer2) extends SparkListener `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68091770
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24811/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68085141
  
    Jenkins, retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67428135
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24562/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67428130
  
      [Test build #24562 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24562/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67420356
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24560/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68089089
  
      [Test build #24811 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24811/consoleFull) for   PR 3726 at commit [`3255f17`](https://github.com/apache/spark/commit/3255f1710d7ffbbbd2de4b098eb444885b2aad36).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68472977
  
    Yeah, LGTM. Merging this. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68314063
  
      [Test build #24869 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24869/consoleFull) for   PR 3726 at commit [`bbbacd1`](https://github.com/apache/spark/commit/bbbacd1a441e43ce46e49bea6c85c6d7834c5487).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68087104
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24806/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67420895
  
    Jenkins, retest this please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68472342
  
    Hey @tdas, is this good to go now?  It would be nice to eliminate this cause of test flakiness, since this seems to be causing a decent number of failures today.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22276054
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala ---
    @@ -178,7 +178,7 @@ private[streaming] class WriteAheadLogBasedBlockHandler(
       }
     
       def cleanupOldBlock(threshTime: Long) {
    --- End diff --
    
    Actually, mind renaming this method to `cleanupOldBlocks`? Realized that it was inconsistent with `cleanupOldBatches` and `cleanupOldLogs`. I know its not your code :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68085163
  
      [Test build #24806 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24806/consoleFull) for   PR 3726 at commit [`e4c83ec`](https://github.com/apache/spark/commit/e4c83eca17c660644216b6d8cc862f8b1654649c).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68078965
  
      [Test build #24791 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24791/consoleFull) for   PR 3726 at commit [`e4c83ec`](https://github.com/apache/spark/commit/e4c83eca17c660644216b6d8cc862f8b1654649c).
     * This patch **fails PySpark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22267099
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala ---
    @@ -139,14 +139,22 @@ private[streaming] class ReceivedBlockTracker(
         getReceivedBlockQueue(streamId).toSeq
       }
     
    -  /** Clean up block information of old batches. */
    +  /** Clean up block information of old batches asynchronously. */
       def cleanupOldBatches(cleanupThreshTime: Time): Unit = synchronized {
    +    cleanupOldBatches(cleanupThreshTime, waitForCompletion = false)
    +  }
    +
    +  /**
    +   * Clean up block information of old batches. If waitForCompletion is true, this method
    +   * returns only after the files are cleaned up.
    +   */
    +  def cleanupOldBatches(cleanupThreshTime: Time, waitForCompletion: Boolean): Unit = synchronized {
    --- End diff --
    
    Why do we need to methods still? We can just have this version, and update the usages everywhere.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67410853
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24556/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67421033
  
      [Test build #24562 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24562/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22276050
  
    --- Diff: streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala ---
    @@ -182,16 +182,34 @@ class WriteAheadLogSuite extends FunSuite with BeforeAndAfter {
       }
     
       test("WriteAheadLogManager - cleanup old logs") {
    +    logCleanUpTest(waitForCompletion = false)
    +  }
    +
    +  test("WriteAheadLogManager - cleanup old logs synchronously") {
    +    logCleanUpTest(waitForCompletion = true)
    +  }
    +
    +  private def logCleanUpTest(waitForCompletion: Boolean): Unit = {
         // Write data with manager, recover with new manager and verify
         val manualClock = new ManualClock
         val dataToWrite = generateRandomData()
         manager = writeDataUsingManager(testDir, dataToWrite, manualClock, stopManager = false)
         val logFiles = getLogFilesInDirectory(testDir)
         assert(logFiles.size > 1)
    -    manager.cleanupOldLogs(manualClock.currentTime() / 2)
    -    eventually(timeout(1 second), interval(10 milliseconds)) {
    +
    +    // To avoid code repeat
    +    def cleanUpAndVerify(): Unit = {
    +      manager.cleanupOldLogs(manualClock.currentTime() / 2, waitForCompletion)
    --- End diff --
    
    This call should be made only once (as in real use), instead of being called multiple times from within a `eventually` block.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68089013
  
    Jenkins, retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68021505
  
    Rather than changing the code to accommodate the tests, i think its better to tweak the test to make it account for the laziness. I would simply change the test [here](https://github.com/apache/spark/pull/3726/files#diff-f623a1fd0c6039bd6eb1746f9cc692c5L173) by making the test in a `eventually` block.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67411133
  
    Failures are in the parquet suite - I don't think it is related to this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by harishreedharan <gi...@git.apache.org>.
Github user harishreedharan commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67411985
  
    Jenkins, retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-67412599
  
      [Test build #24560 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24560/consoleFull) for   PR 3726 at commit [`af00fd1`](https://github.com/apache/spark/commit/af00fd145f05cb7bee2474ee37f366e1fd56912d).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68319258
  
      [Test build #24869 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24869/consoleFull) for   PR 3726 at commit [`bbbacd1`](https://github.com/apache/spark/commit/bbbacd1a441e43ce46e49bea6c85c6d7834c5487).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22267160
  
    --- Diff: streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala ---
    @@ -188,10 +188,8 @@ class WriteAheadLogSuite extends FunSuite with BeforeAndAfter {
         manager = writeDataUsingManager(testDir, dataToWrite, manualClock, stopManager = false)
         val logFiles = getLogFilesInDirectory(testDir)
         assert(logFiles.size > 1)
    -    manager.cleanupOldLogs(manualClock.currentTime() / 2)
    -    eventually(timeout(1 second), interval(10 milliseconds)) {
    -      assert(getLogFilesInDirectory(testDir).size < logFiles.size)
    -    }
    +    manager.cleanupOldLogs(manualClock.currentTime() / 2, waitForCompletion = true)
    +    assert(getLogFilesInDirectory(testDir).size < logFiles.size)
    --- End diff --
    
    Its worth testing both code paths because the async code path is what is going to be used in production.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22267130
  
    --- Diff: streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala ---
    @@ -188,10 +188,8 @@ class WriteAheadLogSuite extends FunSuite with BeforeAndAfter {
         manager = writeDataUsingManager(testDir, dataToWrite, manualClock, stopManager = false)
         val logFiles = getLogFilesInDirectory(testDir)
         assert(logFiles.size > 1)
    -    manager.cleanupOldLogs(manualClock.currentTime() / 2)
    -    eventually(timeout(1 second), interval(10 milliseconds)) {
    -      assert(getLogFilesInDirectory(testDir).size < logFiles.size)
    -    }
    +    manager.cleanupOldLogs(manualClock.currentTime() / 2, waitForCompletion = true)
    +    assert(getLogFilesInDirectory(testDir).size < logFiles.size)
    --- End diff --
    
    Can you extend this unit test to test for `waitForComplete = false` as well. Basically call `manager.cleanupOldLogs(manualClock.currentTime, waitForCompletion = false)` and see with `eventually` that more files gets deleted.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68116279
  
    Looking good, except one (and one optional) comment in the testsuite. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68088937
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24807/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68319259
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24869/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68021927
  
    > Rather than changing the code to accommodate the tests, i think its better to tweak the test to make it account for the laziness. I would simply change the test here by making the test in a eventually block.
    
    In  #3721, I used a `eventually` block previously. It was override by the current fix with `Future`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22264242
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/WriteAheadLogManager.scala ---
    @@ -146,10 +163,15 @@ private[streaming] class WriteAheadLogManager(
           logInfo(s"Cleared log files in $logDirectory older than $threshTime")
         }
         if (!executionContext.isShutdown) {
    -      Future { deleteFiles() }
    +      val f = Future { deleteFiles() }
    +      if (waitForCompletion) {
    +        import scala.concurrent.duration._
    +        Await.ready(f, 1 second)
    --- End diff --
    
    I think its better to not expose implementation details like asynchronous-ness in the signature (i.e. returning `Future`) unless absolutely necessary. 
    
    Also, the timeout is only for testing, so this is not for actual usage. So its okay to have 1 second.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3726#issuecomment-68078967
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24791/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-4790][STREAMING] Fix ReceivedBlockTrack...

Posted by tdas <gi...@git.apache.org>.
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3726#discussion_r22264183
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/WriteAheadLogManager.scala ---
    @@ -124,8 +124,25 @@ private[streaming] class WriteAheadLogManager(
        * files, which is usually based on the local system time. So if there is coordination necessary
        * between the node calculating the threshTime (say, driver node), and the local system time
        * (say, worker node), the caller has to take account of possible time skew.
    +   *
    +   * This method deletes old log files asynchronously.
        */
       def cleanupOldLogs(threshTime: Long): Unit = {
    +    cleanupOldLogs(threshTime, waitForCompletion = false)
    +  }
    +
    +  /**
    +   * Delete the log files that are older than the threshold time.
    +   *
    +   * Its important to note that the threshold time is based on the time stamps used in the log
    +   * files, which is usually based on the local system time. So if there is coordination necessary
    +   * between the node calculating the threshTime (say, driver node), and the local system time
    +   * (say, worker node), the caller has to take account of possible time skew.
    +   *
    +   * If waitForCompletion is set to true, this method will return only after old logs have been
    +   * deleted. Else the files will be deleted asynchronously.
    +   */
    +  def cleanupOldLogs(threshTime: Long, waitForCompletion: Boolean): Unit = {
    --- End diff --
    
    These two signatures can be merged into a single method with default parameters. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org