Jenny
Jenny

Reputation: 1

The grpc message failed to be sent from the container after upgrading grpc lib

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.58.1
com.google.protobuf: 3.24.0

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) ~[?:?]

Upvotes: 0

Views: 73

Answers (1)

Kannan Jayaprakasam
Kannan Jayaprakasam

Reputation: 1

Can you enable debug java.util.logging for io.grpc on the gRPC sender application, so that we can see what happened with the name resolution for the target address?

Upvotes: 0

Related Questions