Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Burgazzoli <[email protected]>
  • Loading branch information
lburgazzoli committed Nov 14, 2024
1 parent acbfa6f commit 1b83f4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 35 deletions.
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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) {
Expand All @@ -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();
}
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@
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;
import io.grpc.Attributes;
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);
Expand All @@ -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) {
Expand All @@ -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();
}
Expand All @@ -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() {
Expand Down

0 comments on commit 1b83f4a

Please sign in to comment.