commit | 950c6197ba2e374ea2171e7b8642ece901e4ce20 | [log] [tgz] |
---|---|---|
author | Michael Blow <michael.blow@couchbase.com> | Mon Oct 02 17:46:07 2017 -0400 |
committer | Michael Blow <mblow@apache.org> | Mon Oct 02 20:44:38 2017 -0700 |
tree | e4c56a02d3efb2b12b969ea4f85f98f2f24f96cc | |
parent | ec151c1dc943bc7b6784a0dec7631aeb6b77e72e [diff] |
[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>
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 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();