[geode] branch develop updated: GEODE-10122: P2P Messaging Handles TLS KeyUpdate Message (#7449)
This is an automated email from the ASF dual-hosted git repository. burcham pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new d2535394a8 GEODE-10122: P2P Messaging Handles TLS KeyUpdate Message (#7449) d2535394a8 is described below commit d2535394a82ac5faf10f004f4e3c15f756f7b177 Author: Bill Burcham AuthorDate: Wed Apr 6 20:14:48 2022 -0700 GEODE-10122: P2P Messaging Handles TLS KeyUpdate Message (#7449) * Key expiration works for TLSv1.3 and GCM-based ciphers * TLS KeyUpdate messages are processed correctly --- .../internal/P2PMessagingConcurrencyDUnitTest.java | 2 +- ...P2pMessagingSslTlsKeyUpdateDistributedTest.java | 367 +++ .../tcp/ConnectionCloseSSLTLSDUnitTest.java| 8 +- .../internal/net/NioSslEngineKeyUpdateTest.java| 497 + .../apache/geode/internal/net/NioSslEngine.java| 69 +-- .../org/apache/geode/internal/tcp/Connection.java | 2 +- .../geode/internal/net/NioSslEngineTest.java | 40 +- 7 files changed, 939 insertions(+), 46 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2PMessagingConcurrencyDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2PMessagingConcurrencyDUnitTest.java index 28abe5dd3e..e761e1bb12 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2PMessagingConcurrencyDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2PMessagingConcurrencyDUnitTest.java @@ -167,7 +167,6 @@ public class P2PMessagingConcurrencyDUnitTest { bytesTransferredAdder = new LongAdder(); final ClusterDistributionManager cdm = getCDM(); - final Random random = new Random(RANDOM_SEED); final AtomicInteger nextSenderId = new AtomicInteger(); /* @@ -194,6 +193,7 @@ public class P2PMessagingConcurrencyDUnitTest { throw new RuntimeException("doSending failed", e); } final int firstMessageId = senderId * SENDER_COUNT; +final Random random = new Random(RANDOM_SEED); for (int messageId = firstMessageId; messageId < firstMessageId + MESSAGES_PER_SENDER; messageId++) { final TestMessage msg = new TestMessage(receiverMember, random, messageId); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2pMessagingSslTlsKeyUpdateDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2pMessagingSslTlsKeyUpdateDistributedTest.java new file mode 100644 index 00..e31f9cfd79 --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2pMessagingSslTlsKeyUpdateDistributedTest.java @@ -0,0 +1,367 @@ +/* + * 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. + */ + +package org.apache.geode.distributed.internal; + +import static org.apache.geode.distributed.ConfigurationProperties.SSL_CIPHERS; +import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS; +import static org.apache.geode.test.awaitility.GeodeAwaitility.await; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.lang.reflect.Field; +import java.security.GeneralSecurityException; +import java.security.Security; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.atomic.LongAdder; + +import junitparams.Parameters; +import org.jetbrains.annotations.NotNull; +import org.junit.After; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; + +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.cache.ssl.CertStores; +import org.apache.geode.cache.ssl.CertificateBuilder; +import org.apache.geode.cache.ssl.CertificateMaterial; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
[geode-native] branch develop updated: Remove spurious comma (#951)
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 d090d68d4 Remove spurious comma (#951) d090d68d4 is described below commit d090d68d41d39d781e589ea0ac5717a29c30b9f5 Author: Michael Martell AuthorDate: Wed Apr 6 14:07:03 2022 -0700 Remove spurious comma (#951) Packer builds for Windows were failing because JSON parsing failed. --- packer/build-windows-2016-vs-2017.json | 2 +- packer/build-windows-2019-vs-2017.json | 2 +- packer/build-windows-2019-vs-2019.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packer/build-windows-2016-vs-2017.json b/packer/build-windows-2016-vs-2017.json index 0c7bb1d0c..3c049ce0c 100644 --- a/packer/build-windows-2016-vs-2017.json +++ b/packer/build-windows-2016-vs-2017.json @@ -92,7 +92,7 @@ "choco install doxygen.install -confirm", "choco install openssl -confirm", "choco install strawberryperl -confirm", -"choco install nuget.commandline -confirm", +"choco install nuget.commandline -confirm" ] }, { diff --git a/packer/build-windows-2019-vs-2017.json b/packer/build-windows-2019-vs-2017.json index ff108d244..727f2a5af 100644 --- a/packer/build-windows-2019-vs-2017.json +++ b/packer/build-windows-2019-vs-2017.json @@ -92,7 +92,7 @@ "choco install doxygen.install -confirm", "choco install openssl -confirm", "choco install strawberryperl -confirm", -"choco install nuget.commandline -confirm", +"choco install nuget.commandline -confirm" ] }, { diff --git a/packer/build-windows-2019-vs-2019.json b/packer/build-windows-2019-vs-2019.json index 3d8f117b2..9fa7916ef 100644 --- a/packer/build-windows-2019-vs-2019.json +++ b/packer/build-windows-2019-vs-2019.json @@ -92,7 +92,7 @@ "choco install doxygen.install -confirm", "choco install openssl -confirm", "choco install strawberryperl -confirm", -"choco install nuget.commandline -confirm", +"choco install nuget.commandline -confirm" ] }, {
[geode] branch develop updated: GEODE-10214: Improve speed of JvmSizeUtils.roundUpSize (#7548)
This is an automated email from the ASF dual-hosted git repository. jensdeppe pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 982f846fb5 GEODE-10214: Improve speed of JvmSizeUtils.roundUpSize (#7548) 982f846fb5 is described below commit 982f846fb5d8b61e617c7d0e1a484ea0664229ab Author: Jens Deppe AuthorDate: Wed Apr 6 13:57:46 2022 -0700 GEODE-10214: Improve speed of JvmSizeUtils.roundUpSize (#7548) This small change improves the speed of this method by about 30% (as per basic JMH benchmarking). benchamrk1 is the original and benchmark2 the change. ``` Benchmark Mode Cnt Score Error Units PerformanceSample.benchmark1 avgt5 3480.815 ± 387.131 us/op PerformanceSample.benchmark2 avgt5 2418.937 ± 586.209 us/op ``` --- .../geode/internal/JvmSizeUtilsBenchmark.java | 78 ++ .../org/apache/geode/internal/JvmSizeUtils.java| 13 ++-- .../geode/internal/JvmSizeUtilsJUnitTest.java | 38 +++ 3 files changed, 121 insertions(+), 8 deletions(-) diff --git a/geode-core/src/jmh/java/org/apache/geode/internal/JvmSizeUtilsBenchmark.java b/geode-core/src/jmh/java/org/apache/geode/internal/JvmSizeUtilsBenchmark.java new file mode 100644 index 00..7756a28024 --- /dev/null +++ b/geode-core/src/jmh/java/org/apache/geode/internal/JvmSizeUtilsBenchmark.java @@ -0,0 +1,78 @@ +/* + * 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. + */ + +package org.apache.geode.internal; + +import java.util.concurrent.TimeUnit; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Run this benchmark individually with: + * + * + *./gradlew -Pjmh.include=JvmSizeUtilsBenchmark geode-core:jmh + * + */ +@State(Scope.Thread) +@Fork(1) +public class JvmSizeUtilsBenchmark { + + private int i = 0; + + @TearDown(Level.Iteration) + public void teardown() { +i++; + } + + @Benchmark + @Measurement(iterations = 5) + @Warmup(iterations = 3) + @BenchmarkMode(Mode.Throughput) + @OutputTimeUnit(TimeUnit.MILLISECONDS) + public long benchmark_roundUpSize() { +return JvmSizeUtils.roundUpSize(i); + } + + @Benchmark + @Measurement(iterations = 5) + @Warmup(iterations = 3) + @BenchmarkMode(Mode.Throughput) + @OutputTimeUnit(TimeUnit.MILLISECONDS) + public long benchmark_old() { +return roundUpSize_old(i); + } + + /** + * For reference, and to compare benchmark numbers, this is the original method. + */ + private static long roundUpSize_old(long size) { +long remainder = size % 8; +if (remainder != 0) { + size += 8 - remainder; +} +return size; + } +} diff --git a/geode-core/src/main/java/org/apache/geode/internal/JvmSizeUtils.java b/geode-core/src/main/java/org/apache/geode/internal/JvmSizeUtils.java index 0731d8395e..673f1a0c55 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/JvmSizeUtils.java +++ b/geode-core/src/main/java/org/apache/geode/internal/JvmSizeUtils.java @@ -135,15 +135,12 @@ public class JvmSizeUtils { return objectHeaderSize; } + /** + * Round up to the nearest 8 bytes. Experimentally, this is what we've seen the sun 32 bit JVM do + * with object size. + */ public static long roundUpSize(long size) { -// Round up to the nearest 8 bytes. Experimentally, this -// is what we've seen the sun 32 bit VM do with object size. -// See https://wiki.gemstone.com/display/rusage/Per+Entry+Overhead -long remainder = size % 8; -if (remainder != 0) { - size += 8 - remainder; -} -return size; +return ((size + 7) & (-8)); } public static int roundUpSize(int size)
[geode] branch develop updated: GEODE-10127: Corrects NullPointerException in hashCode(). (#7559)
This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 44293ffa54 GEODE-10127: Corrects NullPointerException in hashCode(). (#7559) 44293ffa54 is described below commit 44293ffa54ac85b3fd7681af93aff4107d955fa9 Author: Jacob Barrett AuthorDate: Wed Apr 6 13:16:01 2022 -0700 GEODE-10127: Corrects NullPointerException in hashCode(). (#7559) When unmarshalling an instance with a host name that can't be resolved a NullPointerException is thrown in hashCode(). Use Objects.hash() to resolve hash code to avoid NullPointerException. --- .../geode/internal/admin/remote/DistributionLocatorId.java | 10 ++ .../geode/internal/admin/remote/DistributionLocatorIdTest.java | 9 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java index 84b5cbe978..9286b5b1e6 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java @@ -16,6 +16,7 @@ package org.apache.geode.internal.admin.remote; import static java.lang.String.format; +import static java.util.Objects.hash; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.ObjectUtils.getIfNull; import static org.apache.commons.lang3.StringUtils.isEmpty; @@ -335,14 +336,7 @@ public class DistributionLocatorId implements java.io.Serializable { @Override public int hashCode() { -int result = 17; -final int mult = 37; - -result = mult * result + host.hashCode(); -result = mult * result + port; -result = mult * result + bindAddress.hashCode(); - -return result; +return hash(host, port, bindAddress); } /** diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/remote/DistributionLocatorIdTest.java b/geode-core/src/test/java/org/apache/geode/internal/admin/remote/DistributionLocatorIdTest.java index 8ba7d5dc27..4e1b9b149c 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/admin/remote/DistributionLocatorIdTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/admin/remote/DistributionLocatorIdTest.java @@ -16,6 +16,7 @@ package org.apache.geode.internal.admin.remote; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatNoException; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -138,4 +139,12 @@ class DistributionLocatorIdTest { assertThat(locatorId.marshalForClients()).isEqualTo("hostname-for-clients.example.com[1234]"); } + + @SuppressWarnings("ResultOfMethodCallIgnored") + @Test + void hashCodeDoesNotThrowWhenHostIsNull() { +final DistributionLocatorId locatorId = +DistributionLocatorId.unmarshal("unknown.invalid[1234]"); +assertThatNoException().isThrownBy(locatorId::hashCode); + } }
[geode-native] branch develop updated: Ubuntu build break fix, 2nd attempt (#953)
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 c8253c081 Ubuntu build break fix, 2nd attempt (#953) c8253c081 is described below commit c8253c081e8fbe95b64a52030e1f7a14f2b72f37 Author: Blake Bender AuthorDate: Wed Apr 6 13:05:05 2022 -0700 Ubuntu build break fix, 2nd attempt (#953) * Fix Ubuntu build break due to cmake upgrade - New cmake version changes treatment of CMAKE_INSTALL_LIBDIR variable, which now evaluates to different things for xerces build and main client build. As a result, we build Xerces, then go looking to link to it in the wrong place. Hard-coding the path to just 'lib' for now appears to fix the Ubuntu issue without breaking anything else. * 2nd attempt to fix Ubuntu build break - First attempt broke RHEL flavors, and only fixed the first dependent library on Ubuntu - gtest was still looked for in the wrong place - It appears cmake has special code on Ubuntu to use the wrong lib dir iff CMAKE_INSTALL_PREFIX is set to /usr or /usr/local, so we'll set it to something else and see if that does or doesn't break anything else. --- ci/base/base.yml | 4 1 file changed, 4 insertions(+) diff --git a/ci/base/base.yml b/ci/base/base.yml index 34386ea2a..da2649331 100644 --- a/ci/base/base.yml +++ b/ci/base/base.yml @@ -99,6 +99,8 @@ builds: #@yaml/map-key-override params: CMAKE_CONFIGURE_FLAGS: "-DCMAKE_INSTALL_PREFIX=/home/build" + CMAKE_BUILD_FLAGS: "-j16" + CPACK_GENERATORS: "TGZ" - _: #@ template.replace(new_build("ubuntu-20.04")) image_family: build-ubuntu-20-04 @@ -106,5 +108,7 @@ builds: #@yaml/map-key-override params: CMAKE_CONFIGURE_FLAGS: "-DCMAKE_INSTALL_PREFIX=/home/build" + CMAKE_BUILD_FLAGS: "-j16" + CPACK_GENERATORS: "TGZ" configs: [ ]
[geode] branch develop updated: GEODE-10046: Bump 3rd-party dependency versions (#7557)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new f110b9be35 GEODE-10046: Bump 3rd-party dependency versions (#7557) f110b9be35 is described below commit f110b9be3547474e74bc16cf2f24337b90e8fae2 Author: Owen Nichols <34043438+onichols-pivo...@users.noreply.github.com> AuthorDate: Wed Apr 6 12:20:12 2022 -0700 GEODE-10046: Bump 3rd-party dependency versions (#7557) Geode endeavors to regularly update 3rd-party dependencies to increase shelf life, security and reliability of releases. Dependency bumps in this batch: * Bump classgraph from 4.8.141 to 4.8.143 * Bump jetty from 9.4.45.v20220203 to 9.4.46.v20220331 * Bump jna from 5.10.0 to 5.11.0 * Bump junit-pioneer from 1.6.1 to 1.6.2 * Bump lettuce-core from 6.1.6.RELEASE to 6.1.8.RELEASE * Bump maven-artifact from 3.8.1 to 3.8.5 * Bump micrometer-core from 1.8.3 to 1.8.4 * Bump nebula.lint from 17.6.1 to 17.7.0 * Bump netty from 4.1.74.Final to 4.1.75.Final * Bump rat from 0.7.0 to 0.7.1 * Bump shiro-core from 1.8.0 to 1.9.0 * Bump spotless from 6.2.2 to 6.4.1 * Bump spring-boot-starter-web from 2.6.5 to 2.6.6 * Bump swagger-annotations from 1.6.2 to 1.6.6 * Bump tomcat from 9.0.59 to 9.0.62 --- .../src/test/resources/expected-pom.xml| 32 +++ build.gradle | 6 +-- buildSrc/build.gradle | 2 +- .../gradle/plugins/DependencyConstraints.groovy| 24 +-- .../apache/geode/session/tests/TomcatInstall.java | 2 +- .../session/tests/GenericAppServerInstall.java | 2 +- .../integrationTest/resources/assembly_content.txt | 46 +++--- .../resources/gfsh_dependency_classpath.txt| 46 +++--- geode-assembly/src/main/dist/LICENSE | 2 +- .../http_session_mgmt/quick_start.html.md.erb | 4 +- .../tomcat_installing_the_module.html.md.erb | 4 +- .../tomcat_setting_up_the_module.html.md.erb | 2 +- .../resources/dependency_classpath.txt | 46 +++--- 13 files changed, 109 insertions(+), 109 deletions(-) diff --git a/boms/geode-all-bom/src/test/resources/expected-pom.xml b/boms/geode-all-bom/src/test/resources/expected-pom.xml index 994e24bf57..7fc8a34a6d 100644 --- a/boms/geode-all-bom/src/test/resources/expected-pom.xml +++ b/boms/geode-all-bom/src/test/resources/expected-pom.xml @@ -180,7 +180,7 @@ io.github.classgraph classgraph -4.8.141 +4.8.143 io.github.resilience4j @@ -190,17 +190,17 @@ io.lettuce lettuce-core -6.1.6.RELEASE +6.1.8.RELEASE io.micrometer micrometer-core -1.8.3 +1.8.4 io.swagger swagger-annotations -1.6.2 +1.6.6 it.unimi.dsi @@ -265,12 +265,12 @@ net.java.dev.jna jna -5.10.0 +5.11.0 net.java.dev.jna jna-platform -5.10.0 +5.11.0 net.minidev @@ -335,7 +335,7 @@ org.apache.shiro shiro-core -1.8.0 +1.9.0 org.assertj @@ -360,12 +360,12 @@ org.eclipse.jetty jetty-server -9.4.45.v20220203 +9.4.46.v20220331 org.eclipse.jetty jetty-webapp -9.4.45.v20220203 +9.4.46.v20220331 org.eclipse.persistence @@ -465,7 +465,7 @@ org.junit-pioneer junit-pioneer -1.6.1 +1.6.2 org.mockito @@ -620,12 +620,12 @@ io.netty netty-codec-redis -4.1.74.Final +4.1.75.Final io.netty netty-handler -4.1.74.Final +4.1.75.Final org.seleniumhq.selenium @@ -740,22 +740,22 @@ org.springframework.boot spring-boot-starter -2.6.5 +2.6.6 org.springframework.boot spring-boot-starter-jetty -2.6.5 +2.6.6 org.springframework.boot spring-boot-starter-web -2.6.5 +2.6.6 org.springframework.boot spring-boot-starter-data-redis -2.6.5 +2.6.6 org.springframework.session diff --git a/build.gradle b/build.gradle index 52a58c4f7a..ccf150ca34 100755 --- a/build.gradle +++ b/build.gradle @@ -21,13 +21,13 @@ plugins { id "base" id "idea" id "eclipse" - id "com.diffplug.spotless" version
[geode] branch develop updated: GEODE-9991: Refactor for consistency and add tests. (#7533)
This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 75ea5f7f6f GEODE-9991: Refactor for consistency and add tests. (#7533) 75ea5f7f6f is described below commit 75ea5f7f6f8f6cbd751463dfaab6342762858c58 Author: Jacob Barrett AuthorDate: Wed Apr 6 12:11:11 2022 -0700 GEODE-9991: Refactor for consistency and add tests. (#7533) * Combine common configuration into method for consistency. * Adds tests for new extracted methods. --- .../org/apache/geode/internal/net/SSLConfig.java | 40 +++- .../apache/geode/internal/net/SocketCreator.java | 158 + .../apache/geode/internal/net/SSLConfigTest.java | 49 .../geode/internal/net/SocketCreatorTest.java | 247 + 4 files changed, 354 insertions(+), 140 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java b/geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java index 4d32c6e416..a807d545cf 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java +++ b/geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java @@ -192,21 +192,54 @@ public class SSLConfig { } /** - * Returns true if ciphers is either null, empty or is set to "any" (ignoring case) + * Checks if "any" cipher is specified in {@link #getCiphers()} + * + * @return {@code true} if ciphers is either {@code null}, empty or is set to "any" + * (ignoring case), otherwise {@code false}. */ public boolean isAnyCiphers() { +return isAnyCiphers(ciphers); + } + + /** + * Checks if "any" cipher is specified in {@code ciphers}. + * + * @param ciphers Comma or space separated list of cipher names. + * @return {@code true} if {@code ciphers} is either {@code null}, empty or is set to "any" + * (ignoring case), otherwise {@code false}. + */ + public static boolean isAnyCiphers(final String ciphers) { return StringUtils.isBlank(ciphers) || "any".equalsIgnoreCase(ciphers); } /** - * Returns true if protocols is either null, empty or is set to "any" (ignoring case) + * Checks if "any" cipher is specified in {@code ciphers}. + * + * @param ciphers Array of cipher names. + * @return {@code true} if {@code ciphers} is either {@code null}, empty or first entry is "any" + * (ignoring case), otherwise {@code false}. + */ + public static boolean isAnyCiphers(final String... ciphers) { +return ArrayUtils.isEmpty(ciphers) || "any".equalsIgnoreCase(ciphers[0]); + } + + /** + * Checks if "any" protocol is specified in {@code protocols}. + * + * @param protocols Comma or space separated list of protocol names. + * @return {@code true} if {@code protocols} is either {@code null}, empty or is set to "any" + * (ignoring case), otherwise {@code false}. */ public static boolean isAnyProtocols(final String protocols) { return StringUtils.isBlank(protocols) || "any".equalsIgnoreCase(protocols); } /** - * Returns true if protocols is either null, empty or is set to "any" (ignoring case) + * Checks if "any" protocol is specified in {@code protocols}. + * + * @param protocols Array of protocol names. + * @return {@code true} if {@code protocols} is either {@code null}, empty or first entry is "any" + * (ignoring case), otherwise {@code false}. */ public static boolean isAnyProtocols(final String... protocols) { return ArrayUtils.isEmpty(protocols) || "any".equalsIgnoreCase(protocols[0]); @@ -394,7 +427,6 @@ public class SSLConfig { SSLParameterExtension sslParameterExtension = CallbackInstantiator.getObjectOfTypeFromClassName(sslParameterExtensionConfig, SSLParameterExtension.class); - ids.getConfig().getDistributedSystemId(); sslParameterExtension.init( new SSLParameterExtensionContextImpl(ids.getConfig().getDistributedSystemId())); diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java index 097cc2afd8..89795b5377 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java +++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java @@ -12,9 +12,10 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.internal.net; +package org.apache.geode.internal.net; +import static org.apache.commons.lang3.ObjectUtils.getIfNull; import static org.apache.geode.internal.net.filewatch.FileWatchingX509ExtendedKeyManager.newFileWatchingKeyManager; import static
[geode] branch develop updated: GEODE-9704: Ensure that register interest is called before ready for events (#7442)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 30bd1cef01 GEODE-9704: Ensure that register interest is called before ready for events (#7442) 30bd1cef01 is described below commit 30bd1cef01b555c84e970c548cfb0e55f06fbf1c Author: mhansonp AuthorDate: Wed Apr 6 09:27:03 2022 -0700 GEODE-9704: Ensure that register interest is called before ready for events (#7442) - RegisterInterestOps need to happen before ReadyForEventsOp is sent These changes make sure that happens. - Added an InterestResultPolicyCheck Authored-by: Barry Oglesby Un-ignored a test that will reproduce the issue periodically during a number of runs. It is a flaky test without the core fix. Authored-by: Jinmei Liao --- .../tier/sockets/DurableRegistrationDUnitTest.java | 802 - .../DurableRegistrationDistributedTest.java| 703 ++ ...est.java => AuthExpirationDistributedTest.java} | 18 +- ...tTest.java => QueueManagerIntegrationTest.java} | 178 +++-- .../cache/client/internal/QueueManagerImpl.java| 59 +- .../cache/client/internal/ReadyForEventsOp.java| 4 +- .../client/internal/RegisterInterestListOp.java| 4 +- .../client/internal/RegisterInterestTracker.java | 52 +- .../cache/client/internal/ServerRegionProxy.java | 2 +- .../apache/geode/internal/cache/LocalRegion.java | 8 +- .../internal/cache/LocalRegionUpdateUnitTest.java | 149 .../dunit/internal/JUnit4DistributedTestCase.java | 2 +- 12 files changed, 1084 insertions(+), 897 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java deleted file mode 100644 index 51e69cff23..00 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java +++ /dev/null @@ -1,802 +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. - */ -package org.apache.geode.internal.cache.tier.sockets; - -import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_ID; -import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_TIMEOUT; -import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; -import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; -import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; - -import java.util.Collections; -import java.util.Iterator; -import java.util.Properties; -import java.util.Set; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import org.apache.geode.cache.Cache; -import org.apache.geode.cache.CacheException; -import org.apache.geode.cache.InterestResultPolicy; -import org.apache.geode.cache.Region; -import org.apache.geode.cache.client.Pool; -import org.apache.geode.cache.client.PoolFactory; -import org.apache.geode.cache.client.PoolManager; -import org.apache.geode.cache30.CacheSerializableRunnable; -import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.internal.cache.CacheServerImpl; -import org.apache.geode.internal.cache.FilterProfile; -import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.internal.cache.LocalRegion; -import org.apache.geode.internal.cache.PoolFactoryImpl; -import org.apache.geode.test.awaitility.GeodeAwaitility; -import org.apache.geode.test.dunit.Assert; -import org.apache.geode.test.dunit.Host; -import org.apache.geode.test.dunit.LogWriterUtils; -import org.apache.geode.test.dunit.NetworkUtils; -import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.Wait; -import
[geode-benchmarks] branch develop updated: GEODE-10126: Use system properties to configure redis
This is an automated email from the ASF dual-hosted git repository. upthewaterspout pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git The following commit(s) were added to refs/heads/develop by this push: new 0892daf6 GEODE-10126: Use system properties to configure redis 0892daf6 is described below commit 0892daf69939fc5c508856f787690dd61c40 Author: Dan Smith AuthorDate: Wed Apr 6 09:05:04 2022 -0700 GEODE-10126: Use system properties to configure redis Use system properties to configure the redis server, instead of the gemfire properties, which have now been removed. --- .../geode/benchmark/redis/tasks/StartGeodeServer.java | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/StartGeodeServer.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/StartGeodeServer.java index 4b86dafe..f379d028 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/StartGeodeServer.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/StartGeodeServer.java @@ -21,7 +21,6 @@ package org.apache.geode.benchmark.redis.tasks; import static java.lang.String.valueOf; import org.apache.geode.benchmark.tasks.StartServer; -import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.perftest.TestContext; @@ -35,13 +34,15 @@ public class StartGeodeServer extends StartServer { } @Override - protected CacheFactory configureCacheFactory(final CacheFactory cacheFactory, - final TestContext context) - throws Exception { - -return super.configureCacheFactory(cacheFactory, context) -.set("geode-for-redis-enabled", valueOf(true)) -.set("geode-for-redis-port", valueOf(redisPort)); + public void run(TestContext context) throws Exception { +try { + System.setProperty("gemfire.geode-for-redis-port", valueOf(redisPort)); + System.setProperty("gemfire.geode-for-redis-enabled", valueOf(true)); + super.run(context); +} finally { + System.clearProperty("gemfire.geode-for-redis-port"); + System.clearProperty("gemfire.geode-for-redis-enabled"); +} } @Override
[geode] branch develop updated: GEODE-10121: Fix transactional redis commands (#7513)
This is an automated email from the ASF dual-hosted git repository. ringles pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 141d43dc67 GEODE-10121: Fix transactional redis commands (#7513) 141d43dc67 is described below commit 141d43dc67452af4940c24203719e6193be42300 Author: Bala Kaza Venkata <43208983+balak...@users.noreply.github.com> AuthorDate: Wed Apr 6 11:10:17 2022 -0400 GEODE-10121: Fix transactional redis commands (#7513) * GEODE-10121: Fix transactional redis commands MSET, SMOVE commands are transactional but they have not been working as transactional. This commit will fix these commands to behave that way. Authored-by: Bala Kaza Venkata --- .../commands/executor/list/RPopLPushDUnitTest.java | 121 + .../commands/executor/set/SMoveDunitTest.java | 276 + .../commands/executor/string/MSetDUnitTest.java| 93 +++ .../list/AbstractRPopLPushIntegrationTest.java | 6 + .../executor/set/AbstractSMoveIntegrationTest.java | 20 ++ .../commands/executor/string/SetExecutor.java | 3 +- .../redis/internal/data/AbstractRedisData.java | 3 +- .../geode/redis/internal/data/NullRedisData.java | 5 + .../geode/redis/internal/data/RedisData.java | 2 + .../geode/redis/internal/data/RedisList.java | 25 +- .../apache/geode/redis/internal/data/RedisSet.java | 29 ++- 11 files changed, 525 insertions(+), 58 deletions(-) diff --git a/geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/commands/executor/list/RPopLPushDUnitTest.java b/geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/commands/executor/list/RPopLPushDUnitTest.java index e038d2c226..fb338df31d 100644 --- a/geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/commands/executor/list/RPopLPushDUnitTest.java +++ b/geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/commands/executor/list/RPopLPushDUnitTest.java @@ -22,6 +22,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; @@ -32,19 +33,18 @@ import java.util.stream.IntStream; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.JedisCluster; -import org.apache.geode.cache.Region; +import org.apache.geode.cache.CacheWriter; +import org.apache.geode.cache.CacheWriterException; +import org.apache.geode.cache.EntryEvent; +import org.apache.geode.cache.RegionEvent; import org.apache.geode.redis.internal.data.RedisData; import org.apache.geode.redis.internal.data.RedisKey; -import org.apache.geode.redis.internal.data.RedisList; -import org.apache.geode.redis.internal.netty.ExecutionHandlerContext; import org.apache.geode.test.dunit.IgnoredException; -import org.apache.geode.test.dunit.rules.ClusterStartupRule; import org.apache.geode.test.dunit.rules.MemberVM; import org.apache.geode.test.dunit.rules.RedisClusterStartupRule; import org.apache.geode.test.junit.rules.ExecutorServiceRule; @@ -52,7 +52,7 @@ import org.apache.geode.test.junit.rules.ExecutorServiceRule; public class RPopLPushDUnitTest { public static final String KEY_1 = "key1"; public static final String KEY_2 = "key2"; - public static final String THROWING_REDIS_LIST_EXCEPTION = "to be ignored"; + public static final String THROWING_CACHE_WRITER_EXCEPTION = "to be ignored"; @Rule public RedisClusterStartupRule clusterStartUp = new RedisClusterStartupRule(); @@ -142,51 +142,87 @@ public class RPopLPushDUnitTest { future3.get(); } - @Ignore("GEODE-10121") @Test public void rpoplpush_isTransactional() { -String hashTag = "{" + clusterStartUp.getKeyOnServer("tag", 1) + "}"; +IgnoredException.addIgnoredException(THROWING_CACHE_WRITER_EXCEPTION); -// Create two real RedisList entries -String sourceKey = hashTag + KEY_1; -String[] sourceElements = {"sourceElement1", "sourceElement2"}; -jedis.lpush(sourceKey, sourceElements); -String destinationKey = hashTag + KEY_2; -String destinationElement = "destinationElement"; -jedis.lpush(destinationKey, destinationElement); +int primaryVMIndex = 1; +final String tag = "{" + clusterStartUp.getKeyOnServer("tag", primaryVMIndex) + "}"; + +final String sourceKey = tag + KEY_1; +int sourceSize = 2; +List initialElements = makeInitialElementsList(sourceSize); +jedis.lpush(sourceKey, initialElements.toArray(new String[0])); -String throwingRedisListKey = hashTag + "ThrowingRedisList"; -String throwingListElement
[geode] branch develop updated: GEODE-10160: fixes SizeableByteArrayList sizing (#7519)
This is an automated email from the ASF dual-hosted git repository. jensdeppe pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 4cae7ac076 GEODE-10160: fixes SizeableByteArrayList sizing (#7519) 4cae7ac076 is described below commit 4cae7ac07641780663f648ef533cdb9a4b978aac Author: Steve Sienkowski <30511577+steve-si...@users.noreply.github.com> AuthorDate: Wed Apr 6 10:13:38 2022 -0400 GEODE-10160: fixes SizeableByteArrayList sizing (#7519) * Update SizeableByteArrayList with overrides for LinkedList's set() and add() methods to ensure memory overhead is updated appropriately. This helps to correct sizing issues in other RedisList methods such as LINSERT and LTRM. Co-authored-by: Jens Deppe --- .../geode/redis/internal/data/RedisList.java | 19 +-- .../data/collections/SizeableByteArrayList.java| 58 ++- .../collections/SizeableByteArrayListTest.java | 190 - 3 files changed, 234 insertions(+), 33 deletions(-) diff --git a/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java b/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java index 1c48f384ef..4dc66335ad 100644 --- a/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java +++ b/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java @@ -456,24 +456,7 @@ public class RedisList extends AbstractRedisData { public synchronized int elementInsert(byte[] elementToInsert, byte[] referenceElement, boolean before) { -int i = 0; -ListIterator iterator = elementList.listIterator(); - -while (iterator.hasNext()) { - if (Arrays.equals(iterator.next(), referenceElement)) { -if (before) { - iterator.previous(); - iterator.add(elementToInsert); - return i; -} else { - iterator.add(elementToInsert); - return i + 1; -} - } - i++; -} - -return -1; +return elementList.insert(elementToInsert, referenceElement, before); } public synchronized void elementInsert(byte[] toInsert, int index) { diff --git a/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/collections/SizeableByteArrayList.java b/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/collections/SizeableByteArrayList.java index fedc73470b..2e74a61889 100644 --- a/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/collections/SizeableByteArrayList.java +++ b/geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/collections/SizeableByteArrayList.java @@ -136,20 +136,22 @@ public class SizeableByteArrayList extends LinkedList implements Sizeabl } /** - * @param remove in order (smallest to largest) list of indexes to remove + * @param removalList in order (smallest to largest) list of indexes to remove */ - public void removeIndexes(List remove) { -int removeIndex = 0; -int firstIndexToRemove = remove.get(0); + public void removeIndexes(List removalList) { +int removalListIndex = 0; +int firstIndexToRemove = removalList.get(0); +int lastIndexToRemove = removalList.get(removalList.size() - 1); + ListIterator iterator = listIterator(firstIndexToRemove); // Iterates only through the indexes to remove -for (int i = firstIndexToRemove; i <= remove.get(remove.size() - 1); i++) { +for (int index = firstIndexToRemove; index <= lastIndexToRemove; index++) { byte[] element = iterator.next(); - if (i == remove.get(removeIndex)) { + if (index == removalList.get(removalListIndex)) { iterator.remove(); memberOverhead -= calculateByteArrayOverhead(element); -removeIndex++; +removalListIndex++; } } } @@ -175,6 +177,25 @@ public class SizeableByteArrayList extends LinkedList implements Sizeabl return element; } + @Override + public boolean removeLastOccurrence(Object o) { +throw new UnsupportedOperationException(); + } + + @Override + public byte[] set(int index, byte[] newElement) { +byte[] replacedElement = super.set(index, newElement); +memberOverhead -= calculateByteArrayOverhead(replacedElement); +memberOverhead += calculateByteArrayOverhead(newElement); +return replacedElement; + } + + @Override + public void add(int index, byte[] element) { +memberOverhead += calculateByteArrayOverhead(element); +super.add(index, element); + } + @Override public void addFirst(byte[] element) { memberOverhead += calculateByteArrayOverhead(element); @@ -187,8 +208,27 @@ public class SizeableByteArrayList extends LinkedList implements Sizeabl super.addLast(element); } - public boolean removeLastOccurrence(Object o) { -throw new