Thanks to visit codestin.com
Credit goes to github.com

Skip to content

api: Deprecate LoadBalancer.handleResolvedAddresses()#11623

Merged
shivaspeaks merged 87 commits into
grpc:masterfrom
SreeramdasLavanya:FixIssue-11194
Mar 25, 2026
Merged

api: Deprecate LoadBalancer.handleResolvedAddresses()#11623
shivaspeaks merged 87 commits into
grpc:masterfrom
SreeramdasLavanya:FixIssue-11194

Conversation

@SreeramdasLavanya
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 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
Copy Markdown
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
Copy Markdown
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
@shivaspeaks shivaspeaks changed the title api: Deprecate LoadBalancer.handleResolvedAddresses() api: Deprecate LoadBalancer.handleResolvedAddresses() and canHandleEmptyAddressListFromNameResolution() Mar 25, 2026
@shivaspeaks shivaspeaks changed the title api: Deprecate LoadBalancer.handleResolvedAddresses() and canHandleEmptyAddressListFromNameResolution() api: Deprecate LoadBalancer.handleResolvedAddresses() Mar 25, 2026
@shivaspeaks
Copy link
Copy Markdown
Member

I changed the title and then I saw you already changed the description saying the deprecation of its companion..
Nevermind I reverted.

@shivaspeaks shivaspeaks merged commit 37eb736 into grpc:master Mar 25, 2026
16 of 17 checks passed
kannanjgithub pushed a commit to kannanjgithub/grpc-java that referenced this pull request May 4, 2026
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 grpc#11194

---------

Co-authored-by: MV Shiva Prasad <[email protected]>
Co-authored-by: Eric Anderson <[email protected]>
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