falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject falcon git commit: FALCON-2107 NPE in FalconWorkflowEngine::isActive() method
Date Tue, 02 Aug 2016 16:36:23 GMT
Repository: falcon
Updated Branches:
  refs/heads/0.10 f88e21a0e -> eddf2ee5e


FALCON-2107 NPE in FalconWorkflowEngine::isActive() method

Author: bvellanki <bvellanki@hortonworks.com>

Reviewers: "Venkat Ranganathan <venkat@hortonworks.com>"

Closes #254 from bvellanki/FALCON-2107

(cherry picked from commit 117fdcfe518154d634060e7557a5efe320e33362)
Signed-off-by: bvellanki <bvellanki@hortonworks.com>


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/eddf2ee5
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/eddf2ee5
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/eddf2ee5

Branch: refs/heads/0.10
Commit: eddf2ee5ebc371fb7c4a3255e9d421e33fd1eeb2
Parents: f88e21a
Author: bvellanki <bvellanki@hortonworks.com>
Authored: Tue Aug 2 09:36:09 2016 -0700
Committer: bvellanki <bvellanki@hortonworks.com>
Committed: Tue Aug 2 09:36:20 2016 -0700

----------------------------------------------------------------------
 .../falcon/workflow/engine/FalconWorkflowEngine.java | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/eddf2ee5/scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java
b/scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java
index 6dbec0c..82a1bdf 100644
--- a/scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java
+++ b/scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java
@@ -108,12 +108,17 @@ public class FalconWorkflowEngine extends AbstractWorkflowEngine {
 
     @Override
     public boolean isActive(Entity entity) throws FalconException {
-        EntityID id = new EntityID(entity);
-        // Ideally state store should have all entities, but, check anyway.
-        if (STATE_STORE.entityExists(id)) {
-            return STATE_STORE.getEntity(id).getCurrentState() != EntityState.STATE.SUBMITTED;
+        try {
+            EntityID id = new EntityID(entity);
+            // Ideally state store should have all entities, but, check anyway.
+            if (STATE_STORE.entityExists(id)) {
+                return STATE_STORE.getEntity(id).getCurrentState() != EntityState.STATE.SUBMITTED;
+            }
+            return false;
+        } catch (NullPointerException npe) {
+            // FalconJPAService is not always used, so catch NPE and return false
+            return false;
         }
-        return false;
     }
 
     @Override


Mime
View raw message