geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (GEODE-3987) Enforce the uniqueness of a single gateway-receiver per member
Date Wed, 22 Nov 2017 22:31:01 GMT


ASF GitHub Bot commented on GEODE-3987:

jujoramos commented on a change in pull request #1086: GEODE-3987: enforce GatewayReceiver
uniqueness per member.

 File path: geode-core/src/test/java/org/apache/geode/internal/cache/wan/
 @@ -0,0 +1,111 @@
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain
+ * copy of the License at
+ *
+ *
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
the License
+ * or implied. See the License for the specific language governing permissions and limitations
+ * the License.
+ */
+ *
+ */
+package org.apache.geode.internal.cache.wan;
+import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
+import static org.powermock.api.mockito.PowerMockito.when;
+import java.util.Arrays;
+import java.util.Collection;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.modules.junit4.PowerMockRunnerDelegate;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.CacheXmlException;
+import org.apache.geode.cache.wan.GatewayReceiverFactory;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
+import org.apache.geode.util.test.TestUtil;
+@PowerMockIgnore({"*", "*", "*.IntegrationTest"})
+public class GatewayReceiverXmlParsingValidationsTest {
 Review comment:

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Enforce the uniqueness of a single gateway-receiver per member
> --------------------------------------------------------------
>                 Key: GEODE-3987
>                 URL:
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Juan José Ramos Cassella
>            Assignee: Juan José Ramos Cassella
> Within the documentation, both in [Configure Gateway Receivers|]
and [gfsh create gateway-receiver|],
we state that only one {{gateway-receiver}} is allowed per member. However, there is no enforcement
of this rule within the code nor within the schema for the {{cache.xml}} file, so the user
might end up having more than one {{gateway-receiver}} per host.
> It's unknown which {{gateway-receiver}} is going to be used after a restart, making it
hard to configure firewall rules between clusters, if any. The following exception is also
printed in the logs whenever we try to register (only the first one is succesfull) the MBean
for the {{gateway-receiver}}:
> {noformat}
> [warning 2017/11/16 15:27:46.156 PST host1-server1 <Function Execution Processor1>
tid=0x44] GemFire:service=GatewayReceiver,type=Member,member=host1-server1
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.handleResourceEvent(
> 	at org.apache.geode.internal.cache.wan.GatewayReceiverImpl.start(
> 	at org.apache.geode.internal.cache.wan.GatewayReceiverFactoryImpl.create(
> 	at
> 	at
> 	at org.apache.geode.internal.cache.MemberFunctionStreamingMessage.process(
> 	at org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(
> 	at org.apache.geode.distributed.internal.DistributionMessage$
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(
> 	at java.util.concurrent.ThreadPoolExecutor$
> 	at org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(
> 	at org.apache.geode.distributed.internal.DistributionManager$9$
> 	at
> Caused by: GemFire:service=GatewayReceiver,type=Member,member=host1-server1
> 	at com.sun.jmx.mbeanserver.Repository.addMBean(
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(
> 	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(
> 	at
> 	... 18 more
> {noformat}
> The fix implies:
> . Change the {{maxOccurs}} attribute from {{unbounded}} to {{1}} in the {{cache-1.0.xsd}}
> . Add the validation to the {{GatewayReceiverFactoryImpl.create()}} method, as this is
the single entry point for {{GatewayReceiver}} instance creations.

This message was sent by Atlassian JIRA

View raw message