This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
fix: stop overriding the default gRPC executor #869
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c83e909
fix: stop overriding the default gRPC executor
igorbernstein2 b8f47c3
format
igorbernstein2 4bed4a6
annotation
igorbernstein2 ac9fbed
Add tests
igorbernstein2 a566e63
code format
igorbernstein2 989a90a
more tests
igorbernstein2 682ea44
be consistent with channel clean up in tests
igorbernstein2 2fc552a
refactor tests
igorbernstein2 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange. It seems like it can break all existing manual overrides of the executors people may have already introduced. I.e. this method is called in
ClientContext.create()
method to figure out if a "custom" executor from an executor should be used (passed as executorProvider in stub settings).I guess in most cases it used to return
true
, which lead to using the executorProvider from stubSettings, which in its turn (unless user overrides it) leads to using the result ofInstantiatingExecutorProvider.newBuilder().build();
I guess if we are talking about default behavior before this change and after this change it is ok (the default behavior will change, but the new default behavior is supposed to be better).
But if somebody really knew what they where doing and decided to override executorProvider in their stubSettings it seems like it will be ignored now, because
transportChannelProvider.needsExecutor()
inClientContext.create()
will always returnfalse
, ignoring the custom executor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the heart of the PR: the gax executor should not be shared with grpc. The PR proposes that channel executor should be configured on the channel providers instead of piping it through.
If you prefer to pipe it through, then the only approach I can think of is:
Add:
Have
StubSettings#setExecutorProvider()
call both the methods.Add
TransportChannelProvider#acceptsExecutor
Update
ClientContext#create
to have some logic like:To me, this introduces a lot of complexity that is very hard to reason about