Closed velkrish89 closed 11 months ago
Can you ensure that we have only one publisher per application? And can you share the code where you are shutting down the publisher? Ensure to call awaitTermination() after calling shutdown(). Also, was there any version changes that happened?
Closing due to no response. Please open a new bug with the updated info if the issue still persists.
Can you ensure that we have only one publisher per application?
I encountered a similar problem with following log. And this way can help me solve it. Thank you.
Apr 16, 2024 6:04:27 PM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
SEVERE: *~*~*~ Previous channel ManagedChannelImpl{logId=10, target=pubsub.googleapis.com:443} was garbage collected without being shut down! ~*~*~*
Make sure to call shutdown()/shutdownNow()
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:102)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:60)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:51)
at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:662)
at io.grpc.ForwardingChannelBuilder2.build(ForwardingChannelBuilder2.java:254)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:441)
at com.google.api.gax.grpc.ChannelPool.<init>(ChannelPool.java:107)
at com.google.api.gax.grpc.ChannelPool.create(ChannelPool.java:85)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:243)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:237)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:226)
at com.google.cloud.pubsub.v1.stub.GrpcPublisherStub.create(GrpcPublisherStub.java:203)
at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:201)
at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:91)
at com.google.cloud.pubsub.v1.Publisher$Builder.build(Publisher.java:881)
I am encountering an issue with the GCP Pub/Sub Publisher in our application. When publishing a high volume of events (greater than 20 events per second), the ManagedChannel instances are not being shut down properly, leading to resource leaks. This issue is impacting our application's stability.
Environment
GCP Pub/Sub Library Version: 4.7.1 Operating System: Windows 11 Java Version: 17.0.6 GRPC Version: 1.56.1
Steps to reproduce
Code example
Configurations
Publisher
Dependencies
Stack trace