From 1b83f4a37ebc72ecca233310c7633a4ec5c80a69 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Thu, 14 Nov 2024 09:07:55 +0100 Subject: [PATCH] Update deps Signed-off-by: Luca Burgazzoli --- gradle/libs.versions.toml | 6 ++--- gradle/wrapper/gradle-wrapper.properties | 2 +- .../jetcd/resolver/AbstractNameResolver.java | 15 +------------ .../jetcd/test/EtcdClusterNameResolver.java | 22 +++++-------------- 4 files changed, 10 insertions(+), 35 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ba92e78b..10fbae92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -grpc = "1.68.0" +grpc = "1.68.1" log4j = "2.24.1" mockito = "5.14.2" slf4j = "2.0.16" @@ -26,8 +26,8 @@ shadowPlugin = "8.1.1" testLoggerPlugin = "4.0.0" protobufPlugin = "0.9.4" nexusPublishPlugin = "2.0.0" -axionReleasePlugin = "1.18.4" -testRetryPlugin = "1.5.10" +axionReleasePlugin = "1.18.15" +testRetryPlugin = "1.6.0" [libraries] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b415..94113f20 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/jetcd-core/src/main/java/io/etcd/jetcd/resolver/AbstractNameResolver.java b/jetcd-core/src/main/java/io/etcd/jetcd/resolver/AbstractNameResolver.java index 4eb29ad4..ba9ae5e7 100644 --- a/jetcd-core/src/main/java/io/etcd/jetcd/resolver/AbstractNameResolver.java +++ b/jetcd-core/src/main/java/io/etcd/jetcd/resolver/AbstractNameResolver.java @@ -19,7 +19,6 @@ import java.net.URI; import java.util.List; import java.util.Objects; -import java.util.concurrent.Executor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,8 +29,6 @@ import io.grpc.EquivalentAddressGroup; import io.grpc.NameResolver; import io.grpc.Status; -import io.grpc.internal.GrpcUtil; -import io.grpc.internal.SharedResourceHolder; import com.google.common.base.Preconditions; @@ -47,7 +44,6 @@ public abstract class AbstractNameResolver extends NameResolver { private volatile boolean shutdown; private volatile boolean resolving; - private Executor executor; private Listener listener; public AbstractNameResolver(URI targetUri) { @@ -69,7 +65,6 @@ public String getServiceAuthority() { public void start(Listener listener) { synchronized (lock) { Preconditions.checkState(this.listener == null, "already started"); - this.executor = SharedResourceHolder.get(GrpcUtil.SHARED_CHANNEL_EXECUTOR); this.listener = Objects.requireNonNull(listener, "listener"); resolve(); } @@ -86,21 +81,13 @@ public void shutdown() { return; } shutdown = true; - - synchronized (lock) { - if (executor != null) { - executor = SharedResourceHolder.release(GrpcUtil.SHARED_CHANNEL_EXECUTOR, executor); - } - } } private void resolve() { if (resolving || shutdown) { return; } - synchronized (lock) { - executor.execute(this::doResolve); - } + doResolve(); } private void doResolve() { diff --git a/jetcd-test/src/main/java/io/etcd/jetcd/test/EtcdClusterNameResolver.java b/jetcd-test/src/main/java/io/etcd/jetcd/test/EtcdClusterNameResolver.java index 1032aff4..4f108b05 100644 --- a/jetcd-test/src/main/java/io/etcd/jetcd/test/EtcdClusterNameResolver.java +++ b/jetcd-test/src/main/java/io/etcd/jetcd/test/EtcdClusterNameResolver.java @@ -20,10 +20,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.concurrent.Executor; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.etcd.jetcd.launcher.EtcdCluster; import io.etcd.jetcd.launcher.EtcdContainer; @@ -31,11 +27,12 @@ import io.grpc.EquivalentAddressGroup; import io.grpc.NameResolver; import io.grpc.Status; -import io.grpc.internal.GrpcUtil; -import io.grpc.internal.SharedResourceHolder; import com.google.common.base.Preconditions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class EtcdClusterNameResolver extends NameResolver { public static final String SCHEME = "cluster"; private static final Logger LOGGER = LoggerFactory.getLogger(EtcdClusterNameResolver.class); @@ -47,7 +44,6 @@ public class EtcdClusterNameResolver extends NameResolver { private volatile boolean shutdown; private volatile boolean resolving; - private Executor executor; private Listener listener; public EtcdClusterNameResolver(URI targetUri) { @@ -65,7 +61,6 @@ public String getServiceAuthority() { public void start(Listener listener) { synchronized (lock) { Preconditions.checkState(this.listener == null, "already started"); - this.executor = SharedResourceHolder.get(GrpcUtil.SHARED_CHANNEL_EXECUTOR); this.listener = Objects.requireNonNull(listener, "listener"); resolve(); } @@ -82,21 +77,14 @@ public void shutdown() { return; } shutdown = true; - - synchronized (lock) { - if (executor != null) { - executor = SharedResourceHolder.release(GrpcUtil.SHARED_CHANNEL_EXECUTOR, executor); - } - } } private void resolve() { if (resolving || shutdown) { return; } - synchronized (lock) { - executor.execute(this::doResolve); - } + + doResolve(); } private void doResolve() {