[geode-native] branch develop updated: GEODE-8443: Disable Windows SNI test as intended (#638)

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 7106f00  GEODE-8443: Disable Windows SNI test as intended (#638)
7106f00 is described below

commit 7106f001eaaace8fec2ddfffb33b0836939a441b
Author: Blake Bender 
AuthorDate: Thu Aug 20 15:38:53 2020 -0700

GEODE-8443: Disable Windows SNI test as intended (#638)

- It's being run in the test suite due to a typo

Co-authored-by: Blake Bender 
---
 cppcache/integration/test/SNITest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cppcache/integration/test/SNITest.cpp 
b/cppcache/integration/test/SNITest.cpp
index e5052b7..0232bc6 100644
--- a/cppcache/integration/test/SNITest.cpp
+++ b/cppcache/integration/test/SNITest.cpp
@@ -118,7 +118,7 @@ class SNITest : public ::testing::Test {
 };
 
 #if defined(_WIN32)
-TEST_F(SNITest, DISABLE_connectViaProxyTest) {
+TEST_F(SNITest, DISABLED_connectViaProxyTest) {
 #else
 TEST_F(SNITest, connectViaProxyTest) {
 #endif



[geode-native] branch develop updated: Revert "GEODE-8436: Several threads calling PdxInstanceFactory::create() causes seg fault (#635)"

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 7797a12  Revert "GEODE-8436: Several threads calling 
PdxInstanceFactory::create() causes seg fault (#635)"
7797a12 is described below

commit 7797a1266079fd729f40ee1d98709b6f97822b8c
Author: Blake Bender 
AuthorDate: Thu Aug 20 13:32:53 2020 -0700

Revert "GEODE-8436: Several threads calling PdxInstanceFactory::create() 
causes seg fault (#635)"

This reverts commit c791081cb38e225a45c3bb05efb60280fa9caa33.
- Appears to be causing a test failure on RHEL platform
---
 cppcache/integration/test/CMakeLists.txt   |   1 -
 .../integration/test/PdxInstanceFactoryTest.cpp| 107 -
 cppcache/src/PdxTypeRegistry.cpp   |   7 +-
 3 files changed, 4 insertions(+), 111 deletions(-)

diff --git a/cppcache/integration/test/CMakeLists.txt 
b/cppcache/integration/test/CMakeLists.txt
index f5c3a06..233e842 100644
--- a/cppcache/integration/test/CMakeLists.txt
+++ b/cppcache/integration/test/CMakeLists.txt
@@ -48,7 +48,6 @@ add_executable(cpp-integration-test
   StructTest.cpp
   TransactionCleaningTest.cpp
   WanDeserializationTest.cpp
-  PdxInstanceFactoryTest.cpp
 )
 
 target_compile_definitions(cpp-integration-test
diff --git a/cppcache/integration/test/PdxInstanceFactoryTest.cpp 
b/cppcache/integration/test/PdxInstanceFactoryTest.cpp
deleted file mode 100644
index 348b96a..000
--- a/cppcache/integration/test/PdxInstanceFactoryTest.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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 regarding 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 a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-namespace {
-
-using apache::geode::client::Cache;
-using apache::geode::client::CacheableString;
-using apache::geode::client::CacheFactory;
-using apache::geode::client::CacheTransactionManager;
-using apache::geode::client::Pool;
-using apache::geode::client::Region;
-using apache::geode::client::RegionShortcut;
-using std::chrono::minutes;
-
-const std::string regionName = "my_region";
-
-std::shared_ptr createCache() {
-  auto cache = CacheFactory()
-   .set("log-level", "debug")
-   .setPdxReadSerialized(true)
-   .create();
-  return std::make_shared(std::move(cache));
-}
-
-std::shared_ptr createRegion(Cluster& cluster,
- std::shared_ptr cache) {
-  auto poolFactory = cache->getPoolManager().createFactory();
-  cluster.applyLocators(poolFactory);
-  poolFactory.setPRSingleHopEnabled(true);
-
-  auto pool = poolFactory.create("pool");
-  auto regionFactory = cache->createRegionFactory(RegionShortcut::PROXY);
-  auto region = regionFactory.setPoolName("pool").create(regionName);
-
-  return region;
-}
-
-void doPut(std::shared_ptr cache, std::shared_ptr region) {
-  auto factory = cache->createPdxInstanceFactory(
-  "name.string,surname.string,email.string,address.string");
-  factory.writeObject("name", CacheableString::create("John"));
-  factory.writeObject("surname", CacheableString::create("Johnson"));
-  factory.writeObject("email", CacheableString::create("j...@johnson.mail"));
-  factory.writeObject("address", CacheableString::create("Fake St 123"));
-
-  auto pdxInstance = factory.create();
-  region->put(100, pdxInstance);
-}
-
-TEST(PdxInstanceFactoryTest, testConcurrentCreateCalls) {
-  const int NUM_THREADS = 8;
-
-  Cluster cluster{LocatorCount{1}, ServerCount{2}};
-
-  cluster.start();
-
-  cluster.getGfsh()
-  .create()
-  .region()
-  .withName(regionName)
-  .withType("PARTITION")
-  .execute();
-
-  auto cache = createCache();
-  auto region = createRegion(cluster, cache);
-
-  std::vector clientThreads;
-
-  for (int i = 0; i < NUM_THREADS; i++) {
-std::thread th(doPut, cache, region);
-clientThreads.push_back(std::move(th));
-  }
-
-  for (std::thread& th : clientThreads) {
-if (th.joinable()) {
-  th.join();
-}
-  }
-  cache->close();
-}  // test
-
-}  // namespace
diff --git 

[geode] branch support/1.13 updated: GEODE-8432: use regionPath directly instead of getRegion when put eve… (#5464)

2020-08-20 Thread zhouxj
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.13 by this push:
 new a028331  GEODE-8432: use regionPath directly instead of getRegion when 
put eve… (#5464)
a028331 is described below

commit a02833170431a601ce52a56c4cadb0042dac953a
Author: Xiaojian Zhou 
AuthorDate: Wed Aug 19 10:05:51 2020 -0700

GEODE-8432: use regionPath directly instead of getRegion when put eve… 
(#5464)


(cherry picked from commit 6f12a360d82f0de9259557af2bca34cd84e4b5f4)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   | 10 ++---
 .../ParallelGatewaySenderQueueJUnitTest.java   | 49 ++
 2 files changed, 53 insertions(+), 6 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 97d64a7..aff49e1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -650,15 +650,13 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 
 boolean isDREvent = isDREvent(sender.getCache(), value);
 
-Region region = value.getRegion();
-String regionPath = null;
-if (isDREvent) {
-  regionPath = region.getFullPath();
-} else {
+String regionPath = value.getRegionPath();
+if (!isDREvent) {
+  Region region = sender.getCache().getRegion(regionPath, true);
   regionPath = ColocationHelper.getLeaderRegion((PartitionedRegion) 
region).getFullPath();
 }
 if (isDebugEnabled) {
-  logger.debug("Put is for the region {}", region);
+  logger.debug("Put is for the region {}", regionPath);
 }
 if (!this.userRegionNameToShadowPRMap.containsKey(regionPath)) {
   if (isDebugEnabled) {
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
index e7ca1a3..ba4d6ba 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
@@ -17,7 +17,9 @@ package org.apache.geode.internal.cache.wan.parallel;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -36,6 +38,7 @@ import org.mockito.stubbing.Answer;
 
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.PartitionAttributes;
 import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.cache.AbstractBucketRegionQueue;
@@ -72,6 +75,52 @@ public class ParallelGatewaySenderQueueJUnitTest {
   }
 
   @Test
+  public void whenReplicatedDataRegionNotReadyShouldNotThrowException() throws 
Exception {
+GatewaySenderEventImpl event = mock(GatewaySenderEventImpl.class);
+when(event.makeHeapCopyIfOffHeap()).thenReturn(event);
+when(event.getRegion()).thenReturn(null);
+String regionPath = "/testRegion";
+when(event.getRegionPath()).thenReturn(regionPath);
+Mockito.doThrow(new IllegalStateException()).when(event).release();
+Queue backingList = new LinkedList();
+backingList.add(event);
+
+queue = spy(queue);
+doReturn(true).when(queue).isDREvent(any(), any());
+boolean putDone = queue.put(event);
+assertThat(putDone).isFalse();
+  }
+
+  @Test
+  public void whenPartitionedDataRegionNotReadyShouldNotThrowException() 
throws Exception {
+GatewaySenderEventImpl event = mock(GatewaySenderEventImpl.class);
+when(event.makeHeapCopyIfOffHeap()).thenReturn(event);
+when(event.getRegion()).thenReturn(null);
+String regionPath = "/testRegion";
+when(event.getRegionPath()).thenReturn(regionPath);
+PartitionedRegion region = mock(PartitionedRegion.class);
+when(region.getFullPath()).thenReturn(regionPath);
+when(cache.getRegion(regionPath, true)).thenReturn(region);
+PartitionAttributes pa = mock(PartitionAttributes.class);
+when(region.getPartitionAttributes()).thenReturn(pa);
+when(pa.getColocatedWith()).thenReturn(null);
+
+Mockito.doThrow(new 

[geode] branch support/1.13 updated: GEODE-8432: use regionPath directly instead of getRegion when put eve… (#5464)

2020-08-20 Thread zhouxj
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.13 by this push:
 new a028331  GEODE-8432: use regionPath directly instead of getRegion when 
put eve… (#5464)
a028331 is described below

commit a02833170431a601ce52a56c4cadb0042dac953a
Author: Xiaojian Zhou 
AuthorDate: Wed Aug 19 10:05:51 2020 -0700

GEODE-8432: use regionPath directly instead of getRegion when put eve… 
(#5464)


(cherry picked from commit 6f12a360d82f0de9259557af2bca34cd84e4b5f4)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   | 10 ++---
 .../ParallelGatewaySenderQueueJUnitTest.java   | 49 ++
 2 files changed, 53 insertions(+), 6 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 97d64a7..aff49e1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -650,15 +650,13 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 
 boolean isDREvent = isDREvent(sender.getCache(), value);
 
-Region region = value.getRegion();
-String regionPath = null;
-if (isDREvent) {
-  regionPath = region.getFullPath();
-} else {
+String regionPath = value.getRegionPath();
+if (!isDREvent) {
+  Region region = sender.getCache().getRegion(regionPath, true);
   regionPath = ColocationHelper.getLeaderRegion((PartitionedRegion) 
region).getFullPath();
 }
 if (isDebugEnabled) {
-  logger.debug("Put is for the region {}", region);
+  logger.debug("Put is for the region {}", regionPath);
 }
 if (!this.userRegionNameToShadowPRMap.containsKey(regionPath)) {
   if (isDebugEnabled) {
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
index e7ca1a3..ba4d6ba 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueueJUnitTest.java
@@ -17,7 +17,9 @@ package org.apache.geode.internal.cache.wan.parallel;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -36,6 +38,7 @@ import org.mockito.stubbing.Answer;
 
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.PartitionAttributes;
 import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.cache.AbstractBucketRegionQueue;
@@ -72,6 +75,52 @@ public class ParallelGatewaySenderQueueJUnitTest {
   }
 
   @Test
+  public void whenReplicatedDataRegionNotReadyShouldNotThrowException() throws 
Exception {
+GatewaySenderEventImpl event = mock(GatewaySenderEventImpl.class);
+when(event.makeHeapCopyIfOffHeap()).thenReturn(event);
+when(event.getRegion()).thenReturn(null);
+String regionPath = "/testRegion";
+when(event.getRegionPath()).thenReturn(regionPath);
+Mockito.doThrow(new IllegalStateException()).when(event).release();
+Queue backingList = new LinkedList();
+backingList.add(event);
+
+queue = spy(queue);
+doReturn(true).when(queue).isDREvent(any(), any());
+boolean putDone = queue.put(event);
+assertThat(putDone).isFalse();
+  }
+
+  @Test
+  public void whenPartitionedDataRegionNotReadyShouldNotThrowException() 
throws Exception {
+GatewaySenderEventImpl event = mock(GatewaySenderEventImpl.class);
+when(event.makeHeapCopyIfOffHeap()).thenReturn(event);
+when(event.getRegion()).thenReturn(null);
+String regionPath = "/testRegion";
+when(event.getRegionPath()).thenReturn(regionPath);
+PartitionedRegion region = mock(PartitionedRegion.class);
+when(region.getFullPath()).thenReturn(regionPath);
+when(cache.getRegion(regionPath, true)).thenReturn(region);
+PartitionAttributes pa = mock(PartitionAttributes.class);
+when(region.getPartitionAttributes()).thenReturn(pa);
+when(pa.getColocatedWith()).thenReturn(null);
+
+Mockito.doThrow(new 

[geode-native] branch develop updated (629fc8e -> c791081)

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


from 629fc8e  GEODE-8344: Fix Windows build (#637)
 add c791081  GEODE-8436: Several threads calling 
PdxInstanceFactory::create() causes seg fault (#635)

No new revisions were added by this update.

Summary of changes:
 cppcache/integration/test/CMakeLists.txt   |   1 +
 .../integration/test/PdxInstanceFactoryTest.cpp| 107 +
 cppcache/src/PdxTypeRegistry.cpp   |   7 +-
 3 files changed, 111 insertions(+), 4 deletions(-)
 create mode 100644 cppcache/integration/test/PdxInstanceFactoryTest.cpp



[geode-native] branch develop updated (557e018 -> 629fc8e)

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


from 557e018  GEODE-8398: Add SNI support to .NET API  (#634)
 add 629fc8e  GEODE-8344: Fix Windows build (#637)

No new revisions were added by this update.

Summary of changes:
 cppcache/integration/test/WanDeserializationTest.cpp | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)



[geode-native] branch develop updated (629fc8e -> c791081)

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


from 629fc8e  GEODE-8344: Fix Windows build (#637)
 add c791081  GEODE-8436: Several threads calling 
PdxInstanceFactory::create() causes seg fault (#635)

No new revisions were added by this update.

Summary of changes:
 cppcache/integration/test/CMakeLists.txt   |   1 +
 .../integration/test/PdxInstanceFactoryTest.cpp| 107 +
 cppcache/src/PdxTypeRegistry.cpp   |   7 +-
 3 files changed, 111 insertions(+), 4 deletions(-)
 create mode 100644 cppcache/integration/test/PdxInstanceFactoryTest.cpp



[geode-native] branch develop updated (557e018 -> 629fc8e)

2020-08-20 Thread bbender
This is an automated email from the ASF dual-hosted git repository.

bbender pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


from 557e018  GEODE-8398: Add SNI support to .NET API  (#634)
 add 629fc8e  GEODE-8344: Fix Windows build (#637)

No new revisions were added by this update.

Summary of changes:
 cppcache/integration/test/WanDeserializationTest.cpp | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)



[geode] branch develop updated (537721f -> 8a47743)

2020-08-20 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.


from 537721f  GEODE-8419: SSL/TLS protocol and cipher suite configuration 
is ignored (#5465)
 add 8a47743  GEODE-8433: added inheritance of off-heap attribute (#5460)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/cache/RegionFactoryJUnitTest.java | 49 ++
 .../cache/xmlcache/RegionAttributesCreation.java   |  9 
 2 files changed, 58 insertions(+)