spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hunglin <...@git.apache.org>
Subject [GitHub] spark pull request: SPARK-6414: Spark driver failed with NPE on jo...
Date Tue, 31 Mar 2015 02:19:07 GMT
Github user hunglin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5124#discussion_r27448572
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala ---
    @@ -675,7 +675,7 @@ class DAGScheduler(
         // Cancel all jobs belonging to this job group.
         // First finds all active jobs with this group id, and then kill stages for them.
         val activeInGroup = activeJobs.filter(activeJob =>
    -      groupId == activeJob.properties.get(SparkContext.SPARK_JOB_GROUP_ID))
    +      Option(activeJob.properties).exists(_.get(SparkContext.SPARK_JOB_GROUP_ID) == groupId))
    --- End diff --
    
    I think you are right, for the current codes, activeJob.properties will always be non-null.
 But the codes may change in the future, and the above line make sure there won't be NPE even
if activeJob.properties is null.


---
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


Mime
View raw message