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

42 views
Skip to first unread message

Jenny

unread,
Jul 16, 2024, 2:56:42 PM7/16/24
to grpc.io
correct post upgrade version:
-> 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

在2024年7月16日星期二 UTC+8 11:15:28<Jenny> 写道:
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

Kannan Jayaprakasam

unread,
Jul 29, 2024, 9:14:28 AM7/29/24
to grpc.io
Can you enable debug logging in the gRPC Java application? It would be of interest any logs from the name resolution, such as the logs here about addresses resolved or conversely from the onError callback.
Reply all
Reply to author
Forward
0 new messages