Skip to content
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

passthrough scheme not documented #7856

Open
rittneje opened this issue Nov 19, 2024 · 6 comments
Open

passthrough scheme not documented #7856

rittneje opened this issue Nov 19, 2024 · 6 comments
Assignees
Labels
Area: Documentation Includes examples and docs. Type: Documentation Documentation or examples

Comments

@rittneje
Copy link

As far as I can tell, the passthrough:/// scheme does not appear to be documented anywhere. It is needed in order to properly use the bufconn package.

It is mentioned in this comment: #7091 (comment)

It is not mentioned in the language agnostic gRPC docs. https://github.com/grpc/grpc/blob/master/doc/naming.md

@rittneje rittneje added the Type: Feature New features or improvements in behavior label Nov 19, 2024
@purnesh42H
Copy link
Contributor

@rittneje yes, passthrough is only applicable in grpc-go and is already deprecated https://github.com/grpc/grpc-go/blob/master/resolver/passthrough/passthrough.go#L22. It only exist for backward compatibility right now.

@purnesh42H purnesh42H added Area: Documentation Includes examples and docs. Type: Documentation Documentation or examples and removed Type: Feature New features or improvements in behavior labels Nov 20, 2024
@rittneje
Copy link
Author

@purnesh42H First, the file you linked only mentions the package is deprecated and should not be imported. It doesn't mention anything about the scheme itself. Second, it is the only way to get bufconn to work, so you can't just deprecate it without a proper replacement. Please re-open this issue.

@dfinkel
Copy link

dfinkel commented Nov 20, 2024

FWIW, my team switched our bufconn uses to localhost as the address, since that's guaranteed to resolve with the DNS resolver.

@purnesh42H
Copy link
Contributor

yeah, its not explicitly documented that passthrough is deprecated apart from source code but that's because it is internal to grpc-go. In release 1.64, we deprecated grpc.Dial to use grpc.NewClient https://github.com/grpc/grpc-go/releases/tag/v1.64.0. With grpc.Dial the default resolution scheme is passthrough which uses passthrough resolver that i linked above. With grpc.NewClient the default scheme is dns. If you want to use passthrough with grpc.NewClient, you need to pass the adderss prefixed with passthrough:///.

Could you describe what issue you are facing with bufcon though?

Copy link

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Nov 27, 2024
@rittneje
Copy link
Author

@purnesh42H With bufconn, we need to use grpc.WithContextDialer to wire it up correctly. In this case, the target passed to grpc.NewClient is immaterial, but we need to prefix it with passthrough:/// or else it will try to do a DNS resolution anyway and fail.

As passthrough:/// is not documented (and apparently deprecated with no replacement) the only way to figure this out is to stumble across the GitHub comment I originally mentioned. Instead:

  1. the package documentation for google.golang.org/grpc/test/bufconn should directly tell you what to do
  2. either passthrough:/// needs to be un-deprecated, or a proper replacement needs to be added and mentioned in the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Documentation Includes examples and docs. Type: Documentation Documentation or examples
Projects
None yet
Development

No branches or pull requests

3 participants