geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject geode git commit: GEODE-2186: Changing the gateway status to only looking running status
Date Fri, 09 Dec 2016 19:16:54 GMT
Repository: geode
Updated Branches:
  refs/heads/develop adfd41f43 -> 09184881a


GEODE-2186: Changing the gateway status to only looking running status

Gateway senders may or may not be connected, depending on what is going
on with the underlying queue. If a sender is a secondary, it may be
disconnected because it doesn't need to send anything. Even primaries
may be disconnected for periods of time if the connection is lost when
there is nothing in the queue.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/09184881
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/09184881
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/09184881

Branch: refs/heads/develop
Commit: 09184881aec9250fdf2e96f4fced4dedaac0bda7
Parents: adfd41f
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Tue Dec 6 16:52:24 2016 -0800
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Fri Dec 9 11:11:26 2016 -0800

----------------------------------------------------------------------
 .../internal/beans/DistributedSystemBridge.java     |  4 +---
 .../geode/management/WANManagementDUnitTest.java    | 16 +++++++---------
 2 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/09184881/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
index 3016277..5b8c115 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
@@ -1566,10 +1566,8 @@ public class DistributedSystemBridge {
         GatewaySenderMXBean bean = it.next();
         Integer dsId = bean.getRemoteDSId();
         if (dsId != null) {
-          senderMap.put(dsId.toString(), bean.isConnected());
+          senderMap.merge(dsId.toString(), bean.isRunning(), Boolean::logicalAnd);
         }
-
-
       }
 
       return senderMap;

http://git-wip-us.apache.org/repos/asf/geode/blob/09184881/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
b/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
index 3cc37eb..dc801be 100644
--- a/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
@@ -38,7 +38,6 @@ import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.wan.WANTestBase;
 import org.apache.geode.management.internal.MBeanJMXAdapter;
 import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.VM;
 
@@ -54,9 +53,6 @@ public class WANManagementDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
 
-
-  public static MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
-
   public WANManagementDUnitTest() throws Exception {
     super();
   }
@@ -91,6 +87,7 @@ public class WANManagementDUnitTest extends ManagementTestBase {
     managing.invoke(() -> WANTestBase.createManagementCache(punePort));
     startManagingNode(managing);
 
+
     // keep a larger batch to minimize number of exception occurrences in the
     // log
     puneSender
@@ -104,6 +101,7 @@ public class WANManagementDUnitTest extends ManagementTestBase {
     managing.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR",
"pn", 1,
         100, false));
 
+
     nyReceiver.invoke(() -> WANTestBase.createCache(nyPort));
     nyReceiver.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() +
"_PR", null,
         1, 100, false));
@@ -314,11 +312,11 @@ public class WANManagementDUnitTest extends ManagementTestBase {
 
         if (service.isManager()) {
           DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
-          Map<String, Boolean> dsMap = dsBean.viewRemoteClusterStatus();
-
-          LogWriterUtils.getLogWriter()
-              .info("<ExpectedString> Ds Map is: " + dsMap + "</ExpectedString>
");
-
+          Awaitility.await().atMost(1, TimeUnit.MINUTES).until(() -> {
+            Map<String, Boolean> dsMap = dsBean.viewRemoteClusterStatus();
+            dsMap.entrySet().stream()
+                .forEach(entry -> assertTrue("Should be true " + entry.getKey(), entry.getValue()));
+          });
         }
 
       }


Mime
View raw message