Grpc-Java : make sure to call shutdown()/shutdownNow() and wait until awaitTermination
See original GitHub issuePlease answer these questions before submitting your issue.
What version of gRPC are you using?
grpc-core 1.13.1
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.<init>(ManagedChannelOrphanWrapper.java:103) at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(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 ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Make sure to call shutdown()/shutdownNow() and wait until ...
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true. java.lang.RuntimeException: ManagedChannel ...
Read more >Channel ManagedChannelImpl was not shut down properly
(ManagedChannelOrphanWrapper.java:159) Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
Read more >io.grpc.Server.shutdownNow java code examples - Tabnine
Bind and start the server. awaitTermination. Waits for the server to become terminated, giving up if the timeout is reached. shutdown. Initiates an...
Read more >grpc/grpc - Gitter
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true. java.lang.RuntimeException: ManagedChannel allocation site
Read more >Grpc channel is not closed when there is exception ... - Apache
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true. java.lang.RuntimeException: ManagedChannel allocation site at ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here with the
InProcessServerBuilder
and gRPC 1.20.0The PR was https://github.com/grpc/grpc-java/pull/5283 which will end up in the 1.19 release (1.18 happens next week).
Correct.