Skip to content

api: Deprecate LoadBalancer.handleResolvedAddresses()#11623

Open
SreeramdasLavanya wants to merge 87 commits intogrpc:masterfrom
SreeramdasLavanya:FixIssue-11194
Open

api: Deprecate LoadBalancer.handleResolvedAddresses()#11623
SreeramdasLavanya wants to merge 87 commits intogrpc:masterfrom
SreeramdasLavanya:FixIssue-11194

Conversation

@SreeramdasLavanya
Copy link
Contributor

@SreeramdasLavanya SreeramdasLavanya commented Oct 17, 2024

Also deprecate its companion canHandleEmptyAddressListFromNameResolution().
Also fixup the Javadoc to align with the arguments/return values, so that people
would have a better idea of how to use it.

Fixes #11194

@SreeramdasLavanya
Copy link
Contributor Author

Below points have been addressed:

javadoc for public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses)

  • refers to non-existent argument servers

javadoc for public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses)

  • refers to an argument named addresses
  • refers to returning values not of the actual return type

@SreeramdasLavanya SreeramdasLavanya marked this pull request as ready for review October 18, 2024 12:40
* single list if needed.
*
* <p>Implementations can choose to reject the given addresses by returning {@code false}.
* <p>Implementations can choose to reject the given addresses by returning {@code UNAVAILABLE}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace with {@code Status.UNAVAILABLE} . Also below.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Oct 22, 2024
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Oct 22, 2024
@shivaspeaks shivaspeaks requested a review from ejona86 March 16, 2026 06:57
@shivaspeaks
Copy link
Member

I worked on all the open comments and added the commit address comments.

use acceptResolvedAddresses inn ClusterImplLoadBalancer commit was to solve deprecate warning. The other work around was to use suppress warning. Should we suppress it in this PR to only have desired changes? I believe there could be more usages and we can move to acceptResolvedAddresses when cleaning up.

@shivaspeaks shivaspeaks added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Mar 16, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Mar 16, 2026
ejona86 added 9 commits March 23, 2026 15:47
We want to keep the old behavior until the old usages are removed.
Any old implementations that still implement handleResolvedAddresses()
will have their implementationed "skipped" by new callers of
acceptResolvedAddresses(). We've been having such forwarders implement
both methods instead. Since there's very few usages of
handleResolvedAddresses() left, out-of-tree implementations should
generally be fine just swapping to acceptResolvedAddresses.
It should have been completely deleted if the method was being deleted.
In this case, since I've restored the method we just need Deprecated on
the test.
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 23, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 23, 2026
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.

@shivaspeaks, you can see now how the change is basically just the deprecation annotation and the one ClusterImplLoadBalancer fix. My best guess for why ClusterImplLoadBalancer wasn't already migrated is because we might have been in the middle of L74 and didn't want to do any unnecessary changes that would conflict.

@ejona86 ejona86 changed the title api: Javadoc changes for io.grpc.LoadBalancer method signatures api: Deprecate LoadBalancer.handleResolvedAddresses() Mar 24, 2026
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 24, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 24, 2026
@ejona86
Copy link
Member

ejona86 commented Mar 24, 2026

Looks like the version of checkstyle we use on Java 11+ fails to detect Javadoc <p> violations, whereas the one we use with Java 8 still does catch it. I wonder if the Java 17+ one would have caught the violation. (We use Java 8 in a github action, and macos)

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 24, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 24, 2026
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.

io.grpc.LoadBalancer method signatures don't match javadoc

5 participants