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

On result2 resolution result have addresses or error #11330

Conversation

kannanjgithub
Copy link
Contributor

Changes for passing the error status via ResolutionResult, and enhancing the ResolutionResult for the same. This PR is branched from the branch used for #11313 that introduced onResult2 returning the Status.

…the acceptance of the name resolution by the load balancer.
…the acceptance of the name resolution by the load balancer.
…dressesOrError' into onResult2_resolutionResultHaveAddressesOrError

# Conflicts:
#	api/src/main/java/io/grpc/NameResolver.java
#	core/src/test/java/io/grpc/internal/DnsNameResolverTest.java
#	netty/src/test/java/io/grpc/netty/UdsNameResolverTest.java
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

Rebase this once #11313 goes in, as it is hard to read now. We'll want to discuss this in the next API review meeting.

api/src/main/java/io/grpc/StatusOr.java Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
@kannanjgithub
Copy link
Contributor Author

I synced and resolved conflicts from the website, and ended up with some compilation errors. Will pull changes to my cloudtop, fix them and upload the changes.

@ejona86
Copy link
Member

ejona86 commented Aug 2, 2024

Let's discuss this in the next API review meeting.

@kannanjgithub
Copy link
Contributor Author

Let's discuss this in the next API review meeting.

Implemented changes discussed:

  1. Equals/hashCode
  2. of() instead of fromValue()
  3. getValue()/getStatus() instead of value()/status().

@kannanjgithub
Copy link
Contributor Author

Let's discuss this in the next API review meeting.

Implemented changes discussed:

  1. Equals/hashCode
  2. of() instead of fromValue()
  3. getValue()/getStatus() instead of value()/status().
  1. Reverted back of() to fromValue()
  2. allow null in fromValue(value).
  3. getValue() throws if value was never set.
  4. Added experimental-api annotation.

api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/StatusOr.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/NameResolver.java Outdated Show resolved Hide resolved
@kannanjgithub
Copy link
Contributor Author

Code coverage check was failing including for some of the existing lines that I touched that previously didn't have coverage. Fixed all code coverage errors. PTAL @ejona86 .

netty/src/main/java/io/grpc/netty/UdsNameResolver.java Outdated Show resolved Hide resolved
api/src/test/java/io/grpc/NameResolverTest.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/NameResolver.java Outdated Show resolved Hide resolved
api/src/main/java/io/grpc/NameResolver.java Outdated Show resolved Hide resolved
@kannanjgithub kannanjgithub merged commit 1ded8af into grpc:master Oct 7, 2024
15 checks passed
kannanjgithub added a commit to kannanjgithub/grpc-java that referenced this pull request Oct 23, 2024
Combined success / error status passed via ResolutionResult to the NameResolver.Listener2 interface's onResult2 method - Addresses in the success case or address resolution error in the failure case now get set in ResolutionResult::addressesOrError by the internal name resolvers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants