Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6B31D200CB4 for ; Tue, 27 Jun 2017 12:23:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 69C41160BE9; Tue, 27 Jun 2017 10:23:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B0F8D160BDC for ; Tue, 27 Jun 2017 12:23:42 +0200 (CEST) Received: (qmail 14462 invoked by uid 500); 27 Jun 2017 10:23:41 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 14453 invoked by uid 99); 27 Jun 2017 10:23:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2017 10:23:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B2A57DFB0D; Tue, 27 Jun 2017 10:23:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: magyari_sandor@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-21347. Service Page: Some Alerts are missing their Status (magyari_sandor) Date: Tue, 27 Jun 2017 10:23:41 +0000 (UTC) archived-at: Tue, 27 Jun 2017 10:23:43 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.5 4b5e2137e -> dd250992a AMBARI-21347. Service Page: Some Alerts are missing their Status (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dd250992 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dd250992 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dd250992 Branch: refs/heads/branch-2.5 Commit: dd250992acd3c541f325ab0c30673bfc49176fda Parents: 4b5e213 Author: Sandor Magyari Authored: Mon Jun 26 20:01:59 2017 +0200 Committer: Sandor Magyari Committed: Tue Jun 27 12:21:29 2017 +0200 ---------------------------------------------------------------------- .../controller/AmbariManagementControllerImpl.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/dd250992/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index 1db9bc9..827c785 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -187,6 +187,7 @@ import org.apache.ambari.server.state.StackInfo; import org.apache.ambari.server.state.State; import org.apache.ambari.server.state.UnlimitedKeyJCERequirement; import org.apache.ambari.server.state.configgroup.ConfigGroupFactory; +import org.apache.ambari.server.state.fsm.InvalidStateTransitionException; import org.apache.ambari.server.state.quicklinksprofile.QuickLinkVisibilityController; import org.apache.ambari.server.state.quicklinksprofile.QuickLinkVisibilityControllerFactory; import org.apache.ambari.server.state.quicklinksprofile.QuickLinksProfile; @@ -198,6 +199,7 @@ import org.apache.ambari.server.state.stack.WidgetLayout; import org.apache.ambari.server.state.stack.WidgetLayoutInfo; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpInProgressEvent; +import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpSucceededEvent; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostUpgradeEvent; @@ -3062,7 +3064,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle // START task should run configuration script. if (newState == State.INSTALLED && skipInstallTaskForComponent(requestProperties, cluster, scHost)) { LOG.info("Skipping create of INSTALL task for {} on {}.", scHost.getServiceComponentName(), scHost.getHostName()); - scHost.setState(State.INSTALLED); + // set state to INSTALLING, then immediately send an ServiceComponentHostOpSucceededEvent to allow + // transitioning from INSTALLING --> INSTALLED. + scHost.setState(State.INSTALLING); + long now = System.currentTimeMillis(); + try { + scHost.handleEvent(new ServiceComponentHostOpSucceededEvent(scHost.getServiceComponentName(), scHost.getHostName(), now)); + } catch (InvalidStateTransitionException e) { + LOG.error("Error transitioning ServiceComponentHost state to INSTALLED", e); + } } else { createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags, roleCommand, requestParameters, event, skipFailure, effectiveClusterVersion, isUpgradeSuspended,