Skip to content

fix: S2A - skip S2A on platforms where netty-tcnative is not available #3802

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,17 @@ private String determineEndpoint() throws IOException {
/** Determine if S2A can be used */
@VisibleForTesting
boolean shouldUseS2A() {
// If running on windows or macos intel, skip S2A. S2A has runtime
// dependency on netty-tcnative which is dropping support on these platforms.
// https://github.com/netty/netty-tcnative/issues/898
// https://github.com/netty/netty-tcnative/issues/897
if (System.getProperty("os.name").contains("Windows") ||
(System.getProperty("os.name").contains("OS X")
&& System.getProperty("os.arch").contains("x86_64"))) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq, this is a dependency brought in by grpc-s2a, right?

Just wanted to confirm as I don't think this is brought in by Gax.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also feel this is some low level implementation details that Gax does not need to be aware of, can this logic be handled in grpc-java instead of Gax?

Copy link
Contributor Author

@rmehta19 rmehta19 Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lqiu96 and @blakeli0 apologies for the delayed response.

qq, this is a dependency brought in by grpc-s2a, right?Just wanted to confirm as I don't think this is brought in by Gax.

Yes, this is a dependency of grpc-s2a. This dependency is dropping support on the specified platforms so we don't want to try and use S2A when we are on those platforms.

can this logic be handled in grpc-java instead of Gax

This is a good point, technically, I believe the answer is yes, we could just return null / throw an error if you try and use S2A on these platforms. However, there are a few more things I need to confirm, I will follow up with you both and grpc-java internally after I investigate and confirm a few things, and then we can proceed with this PR accordingly.



// If mTLS endpoint is not available, skip S2A
if (Strings.isNullOrEmpty(mtlsEndpoint())) {
return false;
Expand Down
Loading