chore: expose the user set executor on TransportProvider#13557
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new getExecutor() method to the TransportChannelProvider interface and implements it across various channel provider classes. Feedback on the changes highlights that adding a new abstract method to a public interface is a breaking change for external implementations, and suggests providing a default implementation returning null to maintain backward compatibility.
igorbernstein2
force-pushed
the
tp-executor
branch
from
June 25, 2026 16:56
c858eed to
050e330
Compare
This allows service clients to reuse that executor for other transport related things in addition to gax
igorbernstein2
force-pushed
the
tp-executor
branch
from
June 25, 2026 16:57
050e330 to
aa92a9c
Compare
mutianf
approved these changes
Jun 25, 2026
blakeli0
reviewed
Jun 26, 2026
blakeli0
reviewed
Jun 26, 2026
blakeli0
reviewed
Jun 26, 2026
blakeli0
reviewed
Jun 26, 2026
| /** | ||
| * @return the user provided executor. This can be null if the user didn't override the executor | ||
| * and the TransportProvider is using its internal executor. | ||
| * @throws UnsupportedOperationException if the TransportProvider doesn't support this method. |
Contributor
There was a problem hiding this comment.
I might missed this earlier, Java doc needs to be updated as well.
blakeli0
approved these changes
Jun 26, 2026
igorbernstein2
enabled auto-merge (squash)
June 26, 2026 21:31
igorbernstein2
added a commit
to igorbernstein2/google-cloud-java
that referenced
this pull request
Jun 30, 2026
ShimImpl now sources the userCallbackExecutor from the StubSettings when the caller has configured one — either via InstantiatingGrpcChannelProvider's setExecutor (PR googleapis#13557 exposed the getter on TransportChannelProvider) or the legacy StubSettings#setExecutorProvider. Ownership follows the source: transport-set is borrowed by convention; the legacy ExecutorProvider honors shouldAutoClose(). When neither is set the existing behavior is preserved — ShimImpl owns a dedicated bigtable-callback-shim cached pool. Client.userCallbackExecutor widens from Resource<ExecutorService> to Resource<Executor> to accept the borrowed handle; downstream consumers already require only Executor. The standalone Client.create(ClientSettings) path is unchanged: ClientSettings carries no executor wiring to source from.
igorbernstein2
added a commit
to igorbernstein2/google-cloud-java
that referenced
this pull request
Jun 30, 2026
ShimImpl now sources the userCallbackExecutor from the StubSettings when the caller has configured one — either via InstantiatingGrpcChannelProvider's setExecutor (PR googleapis#13557 exposed the getter on TransportChannelProvider) or the legacy StubSettings#setExecutorProvider. Ownership follows the source: transport-set is borrowed by convention; the legacy ExecutorProvider honors shouldAutoClose(). When neither is set the existing behavior is preserved — ShimImpl owns a dedicated bigtable-callback-shim cached pool. Client.userCallbackExecutor widens from Resource<ExecutorService> to Resource<Executor> to accept the borrowed handle; downstream consumers already require only Executor. The standalone Client.create(ClientSettings) path is unchanged: ClientSettings carries no executor wiring to source from.
lqiu96
pushed a commit
that referenced
this pull request
Jun 30, 2026
This allows service clients to reuse that executor for other transport related things in addition to gax
igorbernstein2
added a commit
to igorbernstein2/google-cloud-java
that referenced
this pull request
Jul 1, 2026
ShimImpl now sources the userCallbackExecutor from the StubSettings when the caller has configured one — either via InstantiatingGrpcChannelProvider's setExecutor (PR googleapis#13557 exposed the getter on TransportChannelProvider) or the legacy StubSettings#setExecutorProvider. Ownership follows the source: transport-set is borrowed by convention; the legacy ExecutorProvider honors shouldAutoClose(). When neither is set the existing behavior is preserved — ShimImpl owns a dedicated bigtable-callback-shim cached pool. Client.userCallbackExecutor widens from Resource<ExecutorService> to Resource<Executor> to accept the borrowed handle; downstream consumers already require only Executor. The standalone Client.create(ClientSettings) path is unchanged: ClientSettings carries no executor wiring to source from.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows service clients to reuse that executor for other transport related things in addition to gax