brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] git commit: Nginx: avoid repeated err logging if member has no host+port
Date Wed, 25 Jun 2014 15:08:25 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 0a2b86dc8 -> ba8f2fe65


Nginx: avoid repeated err logging if member has no host+port

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/29f7759a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/29f7759a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/29f7759a

Branch: refs/heads/master
Commit: 29f7759a65aeede7cb6bb6b53e86238da8ca06ab
Parents: f3f2315
Author: Aled Sage <aled.sage@gmail.com>
Authored: Mon Jun 23 17:07:28 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Mon Jun 23 17:07:28 2014 +0100

----------------------------------------------------------------------
 .../entity/proxy/AbstractControllerImpl.java    |  3 ++-
 .../entity/proxy/AbstractControllerTest.java    | 22 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/29f7759a/software/webapp/src/main/java/brooklyn/entity/proxy/AbstractControllerImpl.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/brooklyn/entity/proxy/AbstractControllerImpl.java
b/software/webapp/src/main/java/brooklyn/entity/proxy/AbstractControllerImpl.java
index e455140..65a1a77 100644
--- a/software/webapp/src/main/java/brooklyn/entity/proxy/AbstractControllerImpl.java
+++ b/software/webapp/src/main/java/brooklyn/entity/proxy/AbstractControllerImpl.java
@@ -106,7 +106,8 @@ public abstract class AbstractControllerImpl extends SoftwareProcessImpl
impleme
         serverPoolMemberTrackerPolicy = addPolicy(PolicySpec.create(ServerPoolMemberTrackerPolicy.class)
                 .displayName("Controller targets tracker")
                 .configure("group", serverPool)
-                .configure("sensorsToTrack", sensorsToTrack));
+                .configure("sensorsToTrack", sensorsToTrack)
+                .configure(ServerPoolMemberTrackerPolicy.NOTIFY_ON_DUPLICATES, false));
 
         LOG.info("Added policy {} to {}", serverPoolMemberTrackerPolicy, this);
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/29f7759a/software/webapp/src/test/java/brooklyn/entity/proxy/AbstractControllerTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/AbstractControllerTest.java
b/software/webapp/src/test/java/brooklyn/entity/proxy/AbstractControllerTest.java
index 5e0ce74..088a199 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/AbstractControllerTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/AbstractControllerTest.java
@@ -243,6 +243,28 @@ public class AbstractControllerTest extends BrooklynAppUnitTestSupport
{
         }
     }
 
+    // Manual visual inspection test. Previously it repeatedly logged:
+    //     Unable to construct hostname:port representation for TestEntityImpl{id=jzwSBRQ2}
(null:null); skipping in TrackingAbstractControllerImpl{id=tOn4k5BA}
+    // every time the service-up was set to true again.
+    @Test
+    public void testMemberWithoutHostAndPortDoesNotLogErrorRepeatedly() throws Exception
{
+        controller = app.createAndManageChild(EntitySpec.create(TrackingAbstractController.class)
+                .configure("serverPool", cluster) 
+                .configure("domain", "mydomain"));
+        controller.start(ImmutableList.of(loc));
+        
+        TestEntity child = app.createAndManageChild(EntitySpec.create(TestEntity.class));
+        cluster.addMember(child);
+
+        for (int i = 0; i < 100; i++) {
+            child.setAttribute(Attributes.SERVICE_UP, true);
+        }
+        
+        Thread.sleep(100);
+        List<Collection<String>> u = Lists.newArrayList(controller.getUpdates());
+        assertTrue(u.isEmpty(), "expected no updates, but got "+u);
+    }
+
     private void assertEventuallyAddressesMatchCluster() {
         assertEventuallyAddressesMatch(cluster.getMembers());
     }


Mime
View raw message