Skip to content

Grpc-Java : make sure to call shutdown()/shutdownNow() and wait until awaitTermination #5315

@chsi13

Description

@chsi13

Please answer these questions before submitting your issue.

What version of gRPC are you using?

grpc-core 1.13.1

image

What did you expect to see?

I saw lot ====> of .g.i.ManagedChannelOrphanWrapper : ~* Channel ManagedChannelImpl{logId=5, target=172.30.84.17:6565} was not shutdown properly!!! *~
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.

java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.(ManagedChannelOrphanWrapper.java:103)
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:53)

following each errors (StatusRuntimeException)

Client code :

ManagedChannel channel = ManagedChannelBuilder.forAddress(this.host, this.port).usePlaintext().intercept(interceptors).build();
    T t = runner.apply(stubSupplier.apply(channel).withDeadlineAfter(timeout, TimeUnit.MILLISECONDS));
    try {
      channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
      return t;
    } catch (InterruptedException e) {
      throw new IllegalStateException("Error happened during shutdown of validator gRPC channel", e);
    }

I start a new channel by request. Is-it correct ?

shutdown not done efficiently ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions