Skip to content

Properly integrate async API with server-side cancellations.#5572

Merged
sreecha merged 3 commits intogrpc:masterfrom
vjpai:srv_ctx
Mar 4, 2016
Merged

Properly integrate async API with server-side cancellations.#5572
sreecha merged 3 commits intogrpc:masterfrom
vjpai:srv_ctx

Conversation

@vjpai
Copy link
Copy Markdown
Contributor

@vjpai vjpai commented Mar 3, 2016

There is a comment above IsCancelled that says when it is ok to use this.

Would also appreciate eyes from @ctiller

There is a comment above IsCancelled that says when it is ok to use this.
if (server_try_cancel == CANCEL_BEFORE_PROCESSING) {
ServerTryCancel(&srv_ctx);
srv_ctx.TryCancel();
Verifier(GetParam()).Expect(11, true).Verify(cq_.get());
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.

nit: move the auto verif = Verifier(getParam()) line before this - so that you can use the verif variable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but I also thought that I'd leave it alone for the following reason. This case is the one where the cancel happens before processing, so I thought I'd start over with a clean verifier after it to insure that we're not leaking any state from this part of the test to the next. Is there a strong reason to do it the way you've suggested?

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.

Ok. No strong reason. Just that one might wonder why this is being treated as a special case :).
Actually the CANCEL_*_PROCESSING states are all mutually exclusive.. So there shouldn't be any sharing of state between those cases. I don't feel strongly about and its up to you..

@sreecha
Copy link
Copy Markdown
Contributor

sreecha commented Mar 4, 2016

Looks good to me. The test failures are unrelated to your change.

sreecha added a commit that referenced this pull request Mar 4, 2016
Properly integrate async API with server-side cancellations.
@sreecha sreecha merged commit 22e53cb into grpc:master Mar 4, 2016
@ctiller
Copy link
Copy Markdown
Member

ctiller commented Mar 4, 2016

Which test failure was this fixing?

@vjpai vjpai deleted the srv_ctx branch March 26, 2016 07:16
@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2019
@lock lock bot unassigned sreecha Jan 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants