-
Notifications
You must be signed in to change notification settings - Fork 68
fix: S2A- Check if a default endpoint has been set #3784
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
Merged
lqiu96
merged 12 commits into
googleapis:main
from
rmehta19:dont-check-transport-channel-endpoint
Jun 2, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
09b024e
don't check transport channel provider endpoint.
rmehta19 c4ed18e
merge upstream.
rmehta19 4bf3ade
Merge branch 'main' into dont-check-transport-channel-endpoint
rmehta19 da85450
check transportchannelprovider endpoint not the default endpoint.
rmehta19 be79698
Merge branch 'main' into dont-check-transport-channel-endpoint
rmehta19 6ad5b8e
update tests.
rmehta19 5617650
fix tests.
rmehta19 6fb54f9
fix if condition.
rmehta19 4bba85b
fix if.
rmehta19 5fafdaf
check if clientSettingsEndpoint is default endpoint
rmehta19 604fe07
Merge branch 'main' into dont-check-transport-channel-endpoint
rmehta19 9b52a4e
Merge branch 'main' into dont-check-transport-channel-endpoint
rmehta19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Adding this "contains" logic, since
buildEndpointTemplate
adds443
(https) as default port, andGrpcTransportOptions.setUpChannelProvider
, for example, just sets the host.In this way, we are sure to respect a custom endpoint set via
TransportChannelProvider
. For example, if client specifiedtransportChannelProviderEndpoint
as the http endpoint (default endpoint + port 80),shouldUseS2A
would evaluate to false.@lqiu96
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.
Thanks! I think this does resolve the above concern. Could this check for both clientSettings and transportChannelProvider just to be safe? Or is there a specific reason for only doing this for the transportchannelprovider?
I think the contains logic is fine given the concerns with port. The
string contains == resolved endpoint
may not be completely fool proof (I can't think of counter example off the top of my head), but I think it's safer than removing the check for the transportchannelprovider endpoint.Hopefully this helps unblock the issue with GrpcTransportOptions
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.
I don't see an issue for doing this check for both
clientSettingsEndpoint
andtransportChannelProviderEndpoint
, the reason I initially did it for the latter was because I ran into it in the GrpcTransportOptions case :). I tested this internally and verified that doing this check on both is ok. Added this in the latest commit.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.
FYI, Bigtable has custom code to setEndpoint via settings which I think would be an issue: https://github.com/googleapis/java-bigtable/blob/8d3dca43224179829829bcf91972610c666b130b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java#L807
May be an issue in the future as it auto sets a default. But you would prefer to handle those cases later on, then we can just proceed with this to unblock logging.