Closed qiaofazhan closed 3 months ago
I solved this problem by upgrading GRPC-related dependencies. jetcd has also been upgraded to version 7.7
<dependency>
<artifactId>grpc-protobuf</artifactId>
<groupId>io.grpc</groupId>
<version>1.62.2</version>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>protobuf-java</artifactId>
<groupId>com.google.protobuf</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<artifactId>grpc-stub</artifactId>
<groupId>io.grpc</groupId>
<version>1.62.2</version>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<artifactId>grpc-util</artifactId>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
<groupId>io.grpc</groupId>
<version>1.62.2</version>
</dependency>
<dependency>
<artifactId>grpc-core</artifactId>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
<groupId>io.grpc</groupId>
<version>1.62.2</version>
</dependency>
您好,邮件已收到,尽快给您回复。
Versions
Describe the bug progrem code like this: GetOption op = GetOption.newBuilder().isPrefix(true).build(); CompletableFuture getFuture=
EtcdFactory.getKVClient().get(EtcdFactory.bytesOf(EtcdConstant.KEYPREFIX_PRODUCER),op);
GetResponse response = null;
try {
response = getFuture.get();//keep blocking in java21
} catch (InterruptedException e) {
log.error(Constant.LOG_ERR_PRE+"find etcd producer data error",e);
throw new RuntimeException(e);
} catch (ExecutionException e) {
log.error(Constant.LOG_ERR_PRE+"find etcd producer data error",e);
throw new RuntimeException(e);
}
List list = response.getKvs();
//////////////////////// The above code works fine in java8; When upgrading java8 to java21, the above code will keep blocking the CompletableFuture get method; To Reproduce Run the above code in java21;
Expected behavior CompletableFuture can be returned normally
Additional context