Repository navigation
docs(stub): align setOnReadyHandler javadoc with isReady semantics - #13193
Open
wangkangmao wants to merge 1 commit into
Open
wangkangmao wants to merge 1 commit into
wangkangmao wants to merge 1 commit into
Conversation
|
Member
|
Sign the EasyCLA if you want us the review. |
jdcormie
reviewed
Nov 23, 2026
| * <em>another</em> {@code onReadyHandler} callback. | ||
| * | ||
| * @param onReadyHandler to call when peer is ready to receive more messages. | ||
| * <p>Readiness here has the same meaning as for {@link #isReady}: the observer can accept more |
Member
There was a problem hiding this comment.
This whole paragraph is good rationale for your PR. It would make sense in the commit description but not so much here as a permanent addition to the javadoc. Readiness is already fully explained above, in the isReady() API contract and the javadoc for this class. Better to leave this API's contract defined in terms of the return value of the isReady() method.
How about just saying:
@param onReadyHandler to call when this observer's isReady() transitions from false to true
?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6552.
Problem
CallStreamObserver.setOnReadyHandler()'s@paramsaid the handler is called "when peer is ready to receive more messages". That wording conflicts withCallStreamObserver.isReady()and withClientCall.isReady()/ServerCall.isReady(), which define readiness as the observer being able to accept more messages without excessive buffering internally. Readiness can therefore also come from spare local buffering capacity, not only from the peer requesting data.This is the exact inconsistency a maintainer identified in the review of PR #6561 (which fixed the class-level Javadoc but left this
@paramopen): "the explanation inisReady()is correct, the ... statement in thesetOnReadyHandler()is incorrect."Change
One file, Javadoc only, no behaviour change:
stub/src/main/java/io/grpc/stub/CallStreamObserver.javasetOnReadyHandler()stating that readiness followsisReady()semantics and that the callback does not distinguish peer-requested capacity from local spare buffering.@param onReadyHandlerdescription to "called when the observer becomes ready to accept more messages without excessive buffering", matchingisReady().Verification
Only the changed module was compiled (plus its required
grpc-apidependency):Javadoc generation for the same module, to validate the new tags and links:
git diff --checkproduced no output. No open PR currently references #6552; PR #6561 was merged in 2020 and only addressed the class-level comment.Note
Build dependencies were resolved through a Maven mirror because
repo.maven.apache.orgreturned HTTP 403 in the build environment. The mirror configuration was local-only and is not part of this commit; the commit contains only the Javadoc change.