Navigation Menu

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

Respect requested message limits within a single MessageProducer in BinderTransport. #9163

Merged
merged 4 commits into from May 16, 2022

Conversation

akandratovich
Copy link
Contributor

Add check for request message count in binder grpc inbound stream.

Without check if messages are available and requested, producer provides everything that is available ignoring the request count. It leads to call listener API violation - it's possible that more messages will be provided than requested.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 12, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: akandratovich / name: Andrei Kandratovich (8daca09, 0b4f165)

@markb74 markb74 requested review from ejona86 and markb74 May 12, 2022 13:40
Copy link
Contributor

@markb74 markb74 left a comment

Choose a reason for hiding this comment

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

Looks good to me, but wait for ejona since the new test affects other transport as well.

@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 May 12, 2022
@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 May 12, 2022
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.

I believe flowControlPushBack() would have ordinarily caught this bug, but that test assumes end-to-end flow control which isn't in-place for Binder so the test is disabled. This new test is inherently timing-sensitive (just like flowControlPushBack()) and might not catch bugs. @akandratovich, did you confirm the test fails before the bug fix?

@markb74
Copy link
Contributor

markb74 commented May 12, 2022

@ejona86: I verified it failed before the fix, but that's a good point about timing.

It might help to have the client halfClose, and then awaitHalfClose on the server.

@markb74
Copy link
Contributor

markb74 commented May 12, 2022

Sorry, awaitHalfClose won't help, but adding a doPingPong() call should help.

@ejona86
Copy link
Member

ejona86 commented May 12, 2022

Ah, yes. doPingPong() is how I solved that before.

@akandratovich
Copy link
Contributor Author

I believe flowControlPushBack() would have ordinarily caught this bug, but that test assumes end-to-end flow control which isn't in-place for Binder so the test is disabled. This new test is inherently timing-sensitive (just like flowControlPushBack()) and might not catch bugs. @akandratovich, did you confirm the test fails before the bug fix?

I tried enabling flowControlPushBack(). It feels a bit heuristic for me and I actually managed to tweak buffers enough to make it passing, but ~5% flaky (without fix it fails 100%). But the test is supposed to validate over-rpc flow control and binder doesn't do that. So we decided to make a new test with less scope instead of trying to cheat with flowControlPushBack().

@markb74 markb74 added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label May 13, 2022
@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 May 13, 2022
@ejona86 ejona86 merged commit 2c33e39 into grpc:master May 16, 2022
@akandratovich akandratovich deleted the patch-1 branch May 16, 2022 16:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
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

4 participants