You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Working on desktop application working with google photos. Sometimes having an exception:
Oct 24, 2019 5:22:06 PM io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference cleanQueue
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=17, target=photoslibrary.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:94)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:52)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:43)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:514)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:223)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:164)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:156)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:157)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:122)
at com.google.photos.library.v1.upload.PhotosLibraryUploadStubImpl.<init>(PhotosLibraryUploadStubImpl.java:35)
at com.google.photos.library.v1.upload.PhotosLibraryUploadStubImpl.createStub(PhotosLibraryUploadStubImpl.java:44)
at com.google.photos.library.v1.PhotosLibraryClient.<init>(PhotosLibraryClient.java:103)
at com.google.photos.library.v1.PhotosLibraryClient.initialize(PhotosLibraryClient.java:114)
at org.hurricup.google.PhotosLibraryClientFactory.createClient(PhotosLibraryClientFactory.java:64)
@katrielalex actually I think think this happens because PhotosLibraryClient, after creating PhotosLibraryUploadStub via PhotosLibraryUploadStubImpl.createStub(settings), never closes it. The PhotosLibraryStub does get closed via InternalPhotosLibraryClient#close(), but not the PhotosLibraryUploadStub.
That's correct @ylexus. The issue manifests itself after the GC collects ManagedChannelOrphanWrapper instances and we then want to create or close another connection. Here's a way to reproduce this issue:
PhotosLibraryClientclient1, client2;
client1 = PhotosLibraryClientFactory.createClient(secret_file_path, REQUIRED_SCOPES);
client1.close();
// let the GC dispose of ManagedChannelOrphanWrapper instancesclient1 = null;
System.gc();
Thread.sleep(1000);
// Issue #23client2 = PhotosLibraryClientFactory.createClient(secret_file_path, REQUIRED_SCOPES);
I think it's the same as issue #33. Here's a slightly different way to reproduce that:
PhotosLibraryClientclient1, client2;
client1 = PhotosLibraryClientFactory.createClient(secret_file_path, REQUIRED_SCOPES);
client1.close();
client2 = PhotosLibraryClientFactory.createClient(secret_file_path, REQUIRED_SCOPES);
// let the GC dispose of ManagedChannelOrphanWrapper instancesclient1 = null;
System.gc();
Thread.sleep(1000);
// Issue #33client2.close();
I did a change to close the uploadStub when PhotosLibraryClient closes and that should resolve both issues.
Working on desktop application working with google photos. Sometimes having an exception: