Hi Team,
We want to upgrade the java and python grpc lib of our system. They both run in the container. After the upgrade, we find the java container doesn't send out the grpc message. I used tcpdump to verify.
If the java code run in the host network(not run in the container), the communication between the java code and python container are good.
We'd be appreciated if you could reply.
Details:
-> pre upgrade:
java lib:
io.grpc: 1.30.2
com.google.protobuf: 3.17.3
python lib:
grpcio==1.34.1
grpcio-tools==1.34.1
protobuf==3.14.0
-> post upgrade:
java lib:
io.grpc: 1.30.2
com.google.protobuf: 3.17.3
python lib:
grpcio==1.58.0
grpcio-tools==1.58.0
protobuf==4.24.3
public GetInfoResponse getInfo(GetInfoRequest request) throws RuntimeException {
var observer = new SimpleStreamObserver<GetInfoResponse>(
response -> log.debug("getInfo: received response : {}", response),
throwable -> log.debug("getInfo: received error : {}", throwable.getMessage(), throwable),
() -> log.debug("getInfo: onCompleted invoked.")
);
asyncStub.getInfo(request, observer);
try {
Duration timeoutDuration = Duration.ofSeconds(5);
long timeoutMillis = timeoutDuration.toMillis();
return observer.toCompletionStage()
.toCompletableFuture()
.orTimeout(timeoutMillis, TimeUnit.MILLISECONDS)
.join();
} catch (Throwable e) {
log.error("getInfo Exception: {}", e);
throw new RuntimeException("getInfo timed out", e);
}
}
[2024-07-16 02:40:16.311][ERROR][main][ServiceManagement] GetInfo Exception: {}
java.util.concurrent.CompletionException: java.util.concurrent.TimeoutException
at java.util.concurrent.CompletableFuture.reportJoin(Unknown Source) ~[?:?]
at java.util.concurrent.CompletableFuture.join(Unknown Source) ~[?:?]
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.CompletableFuture$Timeout.run(Unknown Source) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
Thanks,
Jenny