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

Changing gRPC Java inbound flow control symantics #14

Closed
wants to merge 7 commits into from
Closed

Changing gRPC Java inbound flow control symantics #14

wants to merge 7 commits into from

Conversation

nmittler
Copy link
Member

The goal is to mirror the token-based approach used by the Reactive
Streams API.

The goal is to mirror the token-based approach used by the Reactive
Streams API.
@nmittler
Copy link
Member Author

@ejona86 can you take a look at this? This is a rather large PR, so you can start by just reviewing the changes to MessageDeframer ... once we're happy with that we can move on to the rest of the PR.

@nmittler nmittler changed the title Changing gRPC Java inbound flow control model Changing gRPC Java inbound flow control symantics Jan 16, 2015
@ejona86 ejona86 self-assigned this Jan 16, 2015
@nmittler
Copy link
Member Author

@ejona86 submitted changes to address first round of comments.

@nmittler
Copy link
Member Author

@ejona86, just submitted more changes. PTAL when you have a moment.

@nmittler
Copy link
Member Author

@ejona86 I just pushed a couple minor changes to address some of your comments.

}
}, MoreExecutors.directExecutor());
if (closed) {
log.info("Dropping headers received after closing");
Copy link
Member

Choose a reason for hiding this comment

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

I'm questioning whether this should be logged. Given that we could have just simply not decoded the incoming data at all (like we used to do), it seems that the log may just be noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done ... removed all similar logs for both client and server.

@ejona86
Copy link
Member

ejona86 commented Jan 22, 2015

Finished a full review. Only small stuff left. It is looking quite good.

@@ -98,6 +94,14 @@
public abstract void start(Listener<ResponseT> responseListener, Metadata.Headers headers);

/**
* Requests up to the given number of messages from the call to be delivered to
* {@link Listener#onPayload(Object)}. No additional messages will be delivered.
Copy link
Contributor

Choose a reason for hiding this comment

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

some implementations suggest giving a very big number to effectively unbound the stream. worthwhile noting or better left out?

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@nmittler
Copy link
Member Author

@ejona86 @adriancole I think I've addressed all of the comments. Take another look when you have a moment.

@Override
public void request(final int numMessages) {
synchronized (lock) {
requestMessagesFromDeframer(numMessages);
Copy link
Member

Choose a reason for hiding this comment

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

We need a try-catch here, since unlike Netty there isn't anything higher in the transport that will catch an exception here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the best place to handle exceptions is in AbstractStream.requestMessagesFromDeframer, so that it's consistent with AbstractStream.deframe.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds fine to me.

@ejona86
Copy link
Member

ejona86 commented Jan 22, 2015

@nmittler Some small comments, but after those LGTM

@nmittler
Copy link
Member Author

@ejona86 just checked in some changes. If you're ok with changes to AbstractStream.requestMessagesFromDeframer, I'll go ahead and cherry-pick.

@ejona86
Copy link
Member

ejona86 commented Jan 22, 2015

@nmittler LGTM

@nmittler
Copy link
Member Author

Woot! Thanks for reviewing! :)

@nmittler
Copy link
Member Author

Cherry-picked as de3a131

@nmittler nmittler closed this Jan 22, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2019
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.

None yet

3 participants