Skip to content

stub: no initial request when auto inbound flow control is disabled - #4219

Closed
barnardb wants to merge 1 commit into
grpc:masterfrom
barnardb:no-initial-request-when-flow-control-disabled
Closed

barnardb wants to merge 1 commit into
grpc:masterfrom
barnardb:no-initial-request-when-flow-control-disabled

Conversation

@barnardb

Copy link
Copy Markdown

This commit prevents ClientCalls from making an initial request for
response messages when the user provides a ClientResponseObserver that
has disabled auto inbound flow control by calling
ClientCallStreamObserver.disableAutoInboundFlowControl() in beforeStart.

The previous behaviour was confusing and undersirable for observers
trying to implement their own flow control,
as values were produced before they were requested.
This behaviour was mentioned in
#1788 (comment)

The initial requests are still made for ResponseObservers that haven't
disabled auto inbound flow control.

This commit prevents ClientCalls from making an initial request for
response messages when the user provides a ClientResponseObserver that
has disabled auto inbound flow control by calling
ClientCallStreamObserver.disableAutoInboundFlowControl() in beforeStart.

The previous behaviour was confusing and undersirable for observers
trying to implement their own flow control,
as values were produced before they were requested.
This behaviour was mentioned in
grpc#1788 (comment)

The initial requests are still made for ResponseObservers that haven't
disabled auto inbound flow control.
@barnardb
barnardb force-pushed the no-initial-request-when-flow-control-disabled branch from 3bcd619 to f9e57a1 Compare March 14, 2018 23:24
@barnardb barnardb changed the title core: no initial request when auto inbound flow control is disabled stub: no initial request when auto inbound flow control is disabled Mar 14, 2018
@zhangkun83
zhangkun83 requested a review from ejona86 March 15, 2018 18:36
@ejona86

ejona86 commented Mar 19, 2018

Copy link
Copy Markdown
Member

We shouldn't change the behavior of disableAutoInboundFlowControl() as that will break existing users without giving them help upgrading. We do agree the current behavior is confusing. The plan was to create a new method that will disable all automatic request()s and deprecate+remove disableAutoInboundFlowControl().

@barnardb

Copy link
Copy Markdown
Author

Ah, I see. I should have read that comment more clearly.

I could have a go at that approach. Have you had any further thoughts on an appropriate name?

@ejona86

ejona86 commented Mar 22, 2018

Copy link
Copy Markdown
Member

We discussed it today. We're going to go with disableAutoRequest(void). Please have a go with that approach!

@zpencer

zpencer commented Aug 17, 2018

Copy link
Copy Markdown
Contributor

Hi @barnardb friendly ping on this PR.

@ejona86

ejona86 commented Sep 28, 2020

Copy link
Copy Markdown
Member

This was fixed by a combination of #6807 and #7071 . There's now disableAutoRequest() (server-side) and disableAutoRequestWithInitial() (client-side) methods. They were added in v1.30.

@ejona86 ejona86 closed this Sep 28, 2020
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants