Issues with TransportChannel
not getting closed in gax-java library usage
#585
Labels
api: logging
Issues related to the googleapis/java-logging API.
lang: java
Issues specific to Java.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
Steps to reproduce
On instantiating instances of the Logging service multiple times in a row, a
RuntimeException
is thrown in the gRPC libraryCode example
Run this code multiple times in a row and it will eventually throw the error, in my experience.
Stack trace
Any additional information below
There was a previous error very similar to this that was resolved in #212, but I think there is still some similar code with a
TransportChannel
that is not getting closed. The previous fix made sure that theTransportChannel
here (https://github.com/googleapis/java-logging/blob/master/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java#L110) was getting closed, but there is another code path where aClientContext
is getting created here: https://github.com/googleapis/java-logging/blob/master/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java#L142In the creation of the
ClientContext
, it creates its ownTransportChannel
that I think is not being closed in our usage here injava-logging
. See the code in thegax-java
codebase here: https://github.com/googleapis/gax-java/blob/master/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java#L199Hope this helps, thanks!
The text was updated successfully, but these errors were encountered: