Repository: ambari Updated Branches: refs/heads/branch-2.1 09826ec04 -> 408edebab refs/heads/trunk ed6f3ab01 -> 5c219c74a
AMBARI-14014. Pre-upgrade checks sometimes fail with NullPointerException (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5c219c74 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5c219c74 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5c219c74 Branch: refs/heads/trunk Commit: 5c219c74a8015db51affc59a56b7857ae9300083 Parents: ed6f3ab Author: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Authored: Tue Nov 24 14:00:25 2015 +0200 Committer: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Committed: Tue Nov 24 14:00:25 2015 +0200 ---------------------------------------------------------------------- .../apache/ambari/server/state/stack/UpgradePack.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5c219c74/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java index a3207cd..e3155ba 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java @@ -40,6 +40,8 @@ import org.apache.ambari.server.state.stack.upgrade.Grouping; import org.apache.ambari.server.state.stack.upgrade.ServiceCheckGrouping; import org.apache.ambari.server.state.stack.upgrade.Task; import org.apache.ambari.server.state.stack.upgrade.UpgradeType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Represents an upgrade pack. @@ -48,6 +50,8 @@ import org.apache.ambari.server.state.stack.upgrade.UpgradeType; @XmlAccessorType(XmlAccessType.FIELD) public class UpgradePack { + private static Logger LOG = LoggerFactory.getLogger(UpgradePack.class); + /** * Name of the file without the extension, such as upgrade-2.2 */ @@ -317,7 +321,12 @@ public class UpgradePack { Map<String, ProcessingComponent> componentMap = m_process.get(svc.name); for (ProcessingComponent pc : svc.components) { - componentMap.put(pc.name, pc); + if (pc != null) { + componentMap.put(pc.name, pc); + } else { + LOG.warn("ProcessingService {} has null amongst it's values " + + "(total {} components)", svc.name, svc.components.size()); + } } } }