asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: [ASTERIXDB-2120][HYR][RT] Avoid NPE in case of unknown job
Date Tue, 03 Oct 2017 03:44:57 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master ec151c1dc -> 950c6197b


[ASTERIXDB-2120][HYR][RT] Avoid NPE in case of unknown job

Change-Id: I77267aeaf1a0f6498146fe6f0b5777eb6ba47054
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2049
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Integration-Tests: Michael Blow <mblow@apache.org>
Tested-by: Michael Blow <mblow@apache.org>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: 950c6197ba2e374ea2171e7b8642ece901e4ce20
Parents: ec151c1
Author: Michael Blow <michael.blow@couchbase.com>
Authored: Mon Oct 2 17:46:07 2017 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Mon Oct 2 20:44:38 2017 -0700

----------------------------------------------------------------------
 .../control/cc/work/JobletCleanupNotificationWork.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/950c6197/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobletCleanupNotificationWork.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobletCleanupNotificationWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobletCleanupNotificationWork.java
index 5bf721b..337e88f 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobletCleanupNotificationWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobletCleanupNotificationWork.java
@@ -51,12 +51,14 @@ public class JobletCleanupNotificationWork extends AbstractHeartbeatWork
{
     public void runWork() {
         IJobManager jobManager = ccs.getJobManager();
         final JobRun run = jobManager.get(jobId);
+        if (run == null) {
+            LOGGER.log(Level.WARNING, () -> "ignoring unknown job " + jobId + " on notification
from " + nodeId);
+            return;
+        }
         Set<String> cleanupPendingNodes = run.getCleanupPendingNodeIds();
         if (!cleanupPendingNodes.remove(nodeId)) {
-            if (LOGGER.isLoggable(Level.WARNING)) {
-                LOGGER.warning(
-                        nodeId + " not in pending cleanup nodes set: " + cleanupPendingNodes
+ " for Job: " + jobId);
-            }
+            LOGGER.log(Level.WARNING, () -> nodeId + " not in pending cleanup nodes set:
" + cleanupPendingNodes +
+                    " for job " + jobId);
             return;
         }
         INodeManager nodeManager = ccs.getNodeManager();


Mime
View raw message