You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2016/11/14 11:42:24 UTC

[GitHub] spark pull request #15882: [SPARK-18400][STREAMING] NPE when resharding Kine...

GitHub user srowen opened a pull request:

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

    [SPARK-18400][STREAMING] NPE when resharding Kinesis Stream

    ## What changes were proposed in this pull request?
    
    Avoid NPE in KinesisRecordProcessor when shutdown happens without successful init
    
    ## How was this patch tested?
    
    Existing tests

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

    $ git pull https://github.com/srowen/spark SPARK-18400

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

    https://github.com/apache/spark/pull/15882.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 #15882
    
----
commit de7c4d46c86eb724589f9777d0c4bfa58e262d7e
Author: Sean Owen <so...@cloudera.com>
Date:   2016-11-14T11:41:36Z

    Avoid NPE in KinesisRecordProcessor when shutdown happens without successful init

----


---
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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    **[Test build #68632 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68632/consoleFull)** for PR 15882 at commit [`85ca9cc`](https://github.com/apache/spark/commit/85ca9cc9f367c2e8b6bac9ec99cd6a78b8094337).


---
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 #15882: [SPARK-18400][STREAMING] NPE when resharding Kine...

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

    https://github.com/apache/spark/pull/15882#discussion_r87868136
  
    --- Diff: external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisRecordProcessor.scala ---
    @@ -102,27 +101,29 @@ private[kinesis] class KinesisRecordProcessor[T](receiver: KinesisReceiver[T], w
        * @param checkpointer used to perform a Kinesis checkpoint for ShutdownReason.TERMINATE
        * @param reason for shutdown (ShutdownReason.TERMINATE or ShutdownReason.ZOMBIE)
        */
    -  override def shutdown(checkpointer: IRecordProcessorCheckpointer, reason: ShutdownReason) {
    +  override def shutdown(
    +      checkpointer: IRecordProcessorCheckpointer,
    +      reason: ShutdownReason): Unit = {
         logInfo(s"Shutdown:  Shutting down workerId $workerId with reason $reason")
    -    reason match {
    -      /*
    -       * TERMINATE Use Case.  Checkpoint.
    -       * Checkpoint to indicate that all records from the shard have been drained and processed.
    -       * It's now OK to read from the new shards that resulted from a resharding event.
    -       */
    -      case ShutdownReason.TERMINATE =>
    -        receiver.removeCheckpointer(shardId, checkpointer)
    +    if (shardId != null) { // null if not initialized before shutdown
    --- End diff --
    
    cool.  only difference i had in my fix was a LOG message indicating that we hit this situation.  (not sure the log message is actionable, but it is informative)


---
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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/68632/
    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 #15882: [SPARK-18400][STREAMING] NPE when resharding Kine...

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

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


---
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 #15882: [SPARK-18400][STREAMING] NPE when resharding Kine...

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

    https://github.com/apache/spark/pull/15882#discussion_r87784660
  
    --- Diff: external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisRecordProcessor.scala ---
    @@ -102,27 +101,29 @@ private[kinesis] class KinesisRecordProcessor[T](receiver: KinesisReceiver[T], w
        * @param checkpointer used to perform a Kinesis checkpoint for ShutdownReason.TERMINATE
        * @param reason for shutdown (ShutdownReason.TERMINATE or ShutdownReason.ZOMBIE)
        */
    -  override def shutdown(checkpointer: IRecordProcessorCheckpointer, reason: ShutdownReason) {
    +  override def shutdown(
    +      checkpointer: IRecordProcessorCheckpointer,
    +      reason: ShutdownReason): Unit = {
         logInfo(s"Shutdown:  Shutting down workerId $workerId with reason $reason")
    -    reason match {
    -      /*
    -       * TERMINATE Use Case.  Checkpoint.
    -       * Checkpoint to indicate that all records from the shard have been drained and processed.
    -       * It's now OK to read from the new shards that resulted from a resharding event.
    -       */
    -      case ShutdownReason.TERMINATE =>
    -        receiver.removeCheckpointer(shardId, checkpointer)
    +    if (shardId != null) { // null if not initialized before shutdown
    --- End diff --
    
    This is the only substantive change; the rest is style/format fix


---
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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    **[Test build #68632 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68632/consoleFull)** for PR 15882 at commit [`85ca9cc`](https://github.com/apache/spark/commit/85ca9cc9f367c2e8b6bac9ec99cd6a78b8094337).
     * 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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    Merged build finished. 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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    **[Test build #68614 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68614/consoleFull)** for PR 15882 at commit [`de7c4d4`](https://github.com/apache/spark/commit/de7c4d46c86eb724589f9777d0c4bfa58e262d7e).


---
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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    Merged build finished. 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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/68614/
    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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/15882
  
    Merged to master/2.1/2.0


---
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 issue #15882: [SPARK-18400][STREAMING] NPE when resharding Kinesis Str...

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

    https://github.com/apache/spark/pull/15882
  
    **[Test build #68614 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68614/consoleFull)** for PR 15882 at commit [`de7c4d4`](https://github.com/apache/spark/commit/de7c4d46c86eb724589f9777d0c4bfa58e262d7e).
     * 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