Skip to content

Commit

Permalink
GEODE-2186: Changing the gateway status to only looking running status
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
upthewaterspout committed Dec 9, 2016
1 parent adfd41f commit 0918488
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1566,10 +1566,8 @@ public Map<String, Boolean> viewRemoteClusterStatus() {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
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;

Expand All @@ -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();
}
Expand Down Expand Up @@ -91,6 +87,7 @@ public void testMBeanCallback(boolean parallel) throws Exception {
managing.invoke(() -> WANTestBase.createManagementCache(punePort));
startManagingNode(managing);


// keep a larger batch to minimize number of exception occurrences in the
// log
puneSender
Expand All @@ -104,6 +101,7 @@ public void testMBeanCallback(boolean parallel) throws Exception {
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));
Expand Down Expand Up @@ -314,11 +312,11 @@ public void run() {

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()));
});
}

}
Expand Down

0 comments on commit 0918488

Please sign in to comment.