Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beam export job leaks grpc connections #2504

Closed
igorbernstein2 opened this issue Apr 21, 2020 · 5 comments
Closed

beam export job leaks grpc connections #2504

igorbernstein2 opened this issue Apr 21, 2020 · 5 comments
Assignees
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@igorbernstein2
Copy link
Collaborator

Dataflow logs are filled with:

Channel ManagedChannelImpl{logId=3217, target=bigtableadmin.googleapis.com:443} was not shutdown properly!!! *~ Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.

I'm guessing this is an issue with channel pool caching where the dataflow job reuses the same channel pool for data channels, but opens new ones for admin channels.

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/java-bigtable-hbase API. label Apr 21, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 22, 2020
@kolea2 kolea2 added 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. and removed triage me I really want to be triaged. labels Apr 24, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jul 23, 2020
@dmitry-fa dmitry-fa self-assigned this Aug 14, 2020
@dmitry-fa
Copy link
Contributor

The same message appears in the log from running tests:

[INFO] Running com.google.cloud.bigtable.grpc.TestBigtableTableAdminGCJClient
Aug 18, 2020 11:47:27 AM com.google.cloud.bigtable.config.CredentialOptions info
INFO: Enabling the use of null credentials. This should not be used in production.
Aug 18, 2020 11:47:27 AM com.google.cloud.bigtable.config.BigtableVeneerSettingsFactory info
INFO: Enabling the use of null credentials. This should not be used in production.
Aug 18, 2020 11:47:27 AM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=166, target=bigtableadmin.googleapis.com:443} 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:93)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
        at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:518)
        at com.google.cloud.bigtable.grpc.BigtableSession.createNettyChannel(BigtableSession.java:630)
        at com.google.cloud.bigtable.grpc.BigtableSession.createInstanceClient(BigtableSession.java:778)
        at com.google.cloud.bigtable.grpc.TestBigtableSession.testCreateInstanceClient(TestBigtableSession.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        ...

I think that confusing message is due to the bug in the logger: googleapis/java-logging#211 caused by not closing a channel in the GrpcLoggingRpc

@dmitry-fa
Copy link
Contributor

@igorbernstein2 This message no longer appears in the test logs, so I closing this issue. Please reopen it if you meet this message somewhere else.

@dmitry-fa dmitry-fa reopened this Nov 9, 2020
@dmitry-fa
Copy link
Contributor

dmitry-fa commented Nov 9, 2020

The same message appears in the tests for BigTable Hello World snippet.

Nov 09, 2020 11:51:08 AM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=39, target=bigtable.googleapis.com:443} 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:93)
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
	at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:596)
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:261)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:340)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.access$1600(InstantiatingGrpcChannelProvider.java:71)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider$1.createSingleChannel(InstantiatingGrpcChannelProvider.java:236)
	at com.google.api.gax.grpc.ChannelPool.create(ChannelPool.java:72)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:243)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:226)
	at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:169)
	at com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub.create(EnhancedBigtableStub.java:128)
	at com.google.cloud.bigtable.data.v2.BigtableDataClient.create(BigtableDataClient.java:161)
	at com.m.examples.bigtable.HelloWorld.<init>(HelloWorld.java:79)
	at com.m.examples.bigtable.HelloWorldTest.testCreateAndDeleteTable(HelloWorldTest.java:99)

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Nov 9, 2020
@dmitry-fa
Copy link
Contributor

This might happen if a data or admin client is not closing properly.
In the Hello World snippet, the client created at:

78    // Creates a bigtable data client.
79    dataClient = BigtableDataClient.create(settings);

is never closed, quoting stack trace:

at com.m.examples.bigtable.HelloWorld.<init>(HelloWorld.java:79)

Note that the printed stack trace corresponds not the moment when cleanQueue method is invoked, but the instance when the client is created.

@kolea2
Copy link
Collaborator

kolea2 commented Nov 13, 2020

@dmitry-fa going to close this here as this will be resolved by googleapis/java-bigtable#516. If we see it elsewhere, let's raise a new issue in the java-bigtable repo for the samples. Thanks!

@kolea2 kolea2 closed this as completed Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants