Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

GrpcTransportOptions uses internal grpc APIs #1009

Closed
ejona86 opened this issue Nov 4, 2022 · 5 comments · Fixed by #1065
Closed

GrpcTransportOptions uses internal grpc APIs #1009

ejona86 opened this issue Nov 4, 2022 · 5 comments · Fixed by #1065
Assignees
Labels
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.

Comments

@ejona86
Copy link

ejona86 commented Nov 4, 2022

This is reopening #120 which should not have been closed. Internal APIs change without warning, which would break your users. Please remove the usage of the internal APIs.

import io.grpc.internal.SharedResourceHolder;
import io.grpc.internal.SharedResourceHolder.Resource;

@suztomo
Copy link
Member

suztomo commented Nov 24, 2022

Memo: that's the only places in this repository that touch io.grpc.internal package:

~/java-core $ grep -ir 'import io.grpc.internal' .                                                       git[branch:main]
./google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java:import io.grpc.internal.SharedResourceHolder;
./google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java:import io.grpc.internal.SharedResourceHolder.Resource;

The lines were added in 2016 commit 827a94d9 in old repository googleapis/google-cloud-java#1011

image

Todo on me:

  • To understand how the EXECUTOR (which is a io.grpc.internal.SharedResourceHolder.Resource) helps the user of GrpcTransportOptions class.
       /** Shared thread pool executor. */
       private static final Resource<ScheduledExecutorService> EXECUTOR =
           new Resource<ScheduledExecutorService>() {
    
    -> In fix: stop using internal gRPC classes #129 Jeff wrote "SharedResourceHolder is essentially a thread-safe, lazy-initializing, singleton registry for any Resource (something that can be shutdown/closed)."
  • Confirm the internal classes are not leaked to the return value of public methods of GrpcTransportOptions class.
    -> Not leaked.

@diegomarquezp diegomarquezp 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. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 12, 2022
@ejona86
Copy link
Author

ejona86 commented Dec 12, 2022

What sort of timeframe does p3 mean this might get fixed? I opened the original issue 3.5 years ago. P3 makes me worry it will be another 3 years and nothing will have happened here. Given this is a diamond dependency danger, it seems inappropriate to be p3.

If this is fixed tomorrow, it will still be an issue for another year-ish afterward, as users should be able to upgrade their grpc version at-will and they may be using an older java-core version.

@suztomo
Copy link
Member

suztomo commented Dec 12, 2022

@ejona86 I'm afraid p3 is not high priority and it may not match the urgency you have in mind. Do you have a plan to remove or restrict the access of theio.grpc.internal.SharedResourceHolder? It may change the priority in our team.

@suztomo
Copy link
Member

suztomo commented Dec 12, 2022

@chingor13 I see #129 might fix the issue. What was the problem that prevented you from merging it?

@suztomo
Copy link
Member

suztomo commented Dec 13, 2022

@ejona86 We will discuss this in a team meeting and will get back to you in few days.

@suztomo suztomo added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Dec 13, 2022
@dangazineu dangazineu removed the priority: p3 Desirable enhancement or fix. May not be included in next release. label Dec 13, 2022
@diegomarquezp diegomarquezp self-assigned this Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants