brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [8/9] brooklyn-server git commit: BROOKLYN-325 Additional logging
Date Fri, 30 Sep 2016 09:00:34 GMT
BROOKLYN-325 Additional logging


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/9b88108d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/9b88108d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/9b88108d

Branch: refs/heads/master
Commit: 9b88108d23ed8fca2f959a79ac1879ac1b6571c7
Parents: 8fa71f7
Author: Ivana Yovcheva <ivana.yovcheva@gmail.com>
Authored: Thu Sep 29 17:54:29 2016 +0300
Committer: Ivana Yovcheva <ivana.yovcheva@gmail.com>
Committed: Fri Sep 30 10:47:47 2016 +0300

----------------------------------------------------------------------
 .../brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java  | 8 ++++++--
 .../apache/brooklyn/core/mgmt/rebind/RebindIteration.java    | 5 +----
 .../base/SoftwareProcessRebindNotRunningEntityTest.java      | 8 --------
 3 files changed, 7 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9b88108d/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
index 91a8d1b..5c284bf 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
@@ -33,6 +33,7 @@ import org.apache.brooklyn.api.sensor.AttributeSensor;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.enricher.AbstractEnricher;
 import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.core.entity.Attributes;
 import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
@@ -41,6 +42,7 @@ import org.apache.brooklyn.core.mgmt.rebind.dto.MementosGenerators;
 import org.apache.brooklyn.core.objs.AbstractBrooklynObject;
 import org.apache.brooklyn.core.policy.AbstractPolicy;
 import org.apache.brooklyn.entity.group.AbstractGroupImpl;
+import org.apache.brooklyn.entity.stock.BasicApplication;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -237,12 +239,14 @@ public class BasicEntityRebindSupport extends AbstractBrooklynObjectRebindSuppor
             }
         }
     }
-    
+
+    @Override
     protected void instanceRebind(AbstractBrooklynObject instance) {
         Preconditions.checkState(instance == entity, "Expected %s and %s to match, but different
objects", instance, entity);
         Lifecycle expectedState = ServiceStateLogic.getExpectedState(entity);
         if (expectedState == Lifecycle.STARTING || expectedState == Lifecycle.STOPPING) {
-            LOG.warn("Entity "+entity);
+            LOG.warn("Entity {} goes on-fire because it was in state {} on rebind", entity,
expectedState);
+            LOG.warn("not-up-indicators={}", entity.getAttribute(Attributes.SERVICE_NOT_UP_INDICATORS));
             ServiceStateLogic.setExpectedState(entity, Lifecycle.ON_FIRE);
         }
         super.instanceRebind(instance);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9b88108d/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
index ccd3fe1..4aee9a8 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
@@ -69,8 +69,6 @@ import org.apache.brooklyn.core.enricher.AbstractEnricher;
 import org.apache.brooklyn.core.entity.AbstractApplication;
 import org.apache.brooklyn.core.entity.AbstractEntity;
 import org.apache.brooklyn.core.entity.EntityInternal;
-import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.feed.AbstractFeed;
 import org.apache.brooklyn.core.location.AbstractLocation;
 import org.apache.brooklyn.core.location.internal.LocationInternal;
@@ -689,9 +687,8 @@ public abstract class RebindIteration {
         Set<String> oldEntities = Sets.newLinkedHashSet(entityManager.getEntityIds());
         for (Entity entity: rebindContext.getEntities()) {
             ManagementTransitionMode oldMode = updateTransitionMode(entityManager, entity);
-            if (oldMode!=null) {
+            if (oldMode!=null)
                 oldEntities.remove(entity.getId());
-            }
         }
         List<Application> apps = Lists.newArrayList();
         for (String rootId : getMementoRootEntities()) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9b88108d/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessRebindNotRunningEntityTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessRebindNotRunningEntityTest.java
b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessRebindNotRunningEntityTest.java
index 0e38e3f..f7e02b9 100644
--- a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessRebindNotRunningEntityTest.java
+++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessRebindNotRunningEntityTest.java
@@ -70,14 +70,6 @@ import com.google.common.util.concurrent.MoreExecutors;
 
 public class SoftwareProcessRebindNotRunningEntityTest extends RebindTestFixtureWithApp {
 
-    // TODO We'd like to record the fact that we were starting or stopping, rather than just
say "on-fire".
-    // For example, we can use the Attributes.SERVICE_NOT_UP_INDICATORS to say what went
wrong.
-    
-    // TODO If we fail during provisioningLocation.obtain() or provisioningLocation.release(),
then we
-    // should tell the user that a VM might have started being provisioned but been forgotten
about; or
-    // that termination of the VM may or may not have completed.
-    // We could use the Attributes.SERVICE_NOT_UP_INDICATORS to achieve that.
-
     private ListeningExecutorService executor;
     private LocationSpec<SshMachineLocation> machineSpec;
     private FixedListMachineProvisioningLocation<?> locationProvisioner;


Mime
View raw message