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

core: server stream should not deliver halfClose() when call is immediately cancelled #9362

Merged

Conversation

YifeiZhuang
Copy link
Contributor

@YifeiZhuang YifeiZhuang commented Jul 11, 2022

Client sends headers, message and halfClose.
Before server can complete the call, RST_STREAM is sent because of cancellation.
Due to server application request() (run in serializingExecutor) possibly delay, server stream scheduled halfClose() (run in serializingExecutor) before MessageAvailable(), causing INTERNAL, desc: Half-closed without a request at server call.

fix #8866

@YifeiZhuang YifeiZhuang requested a review from ejona86 July 11, 2022 23:19
@YifeiZhuang YifeiZhuang merged commit f9d5ce7 into grpc:master Jul 12, 2022
@YifeiZhuang YifeiZhuang added the TODO:backport PR needs to be backported. Removed after backport complete label Jul 12, 2022
@YifeiZhuang YifeiZhuang deleted the server-partial-message-no-halfclose branch July 12, 2022 17:31
@YifeiZhuang
Copy link
Contributor Author

@ejona86 do we want to back port the change to v1.48?

@ejona86
Copy link
Member

ejona86 commented Jul 18, 2022

Yeah, we want this in v1.48

YifeiZhuang added a commit to YifeiZhuang/grpc-java that referenced this pull request Jul 28, 2022
…iately cancelled(grpc#9362)

Fix a bug where the server stream delivers halfClose() to the call during cancellation. It happens when call has a short deadline. Server sees `INTERNAL, desc: Half-closed without a request` due to the bug.
YifeiZhuang added a commit that referenced this pull request Jul 29, 2022
…iately cancelled(#9362)

Fix a bug where the server stream delivers halfClose() to the call during cancellation. It happens when call has a short deadline. Server sees `INTERNAL, desc: Half-closed without a request` due to the bug.
@YifeiZhuang YifeiZhuang removed the TODO:backport PR needs to be backported. Removed after backport complete label Jul 29, 2022
@irock
Copy link

irock commented Aug 3, 2022

Thanks for this patch @YifeiZhuang! I have confirmed it fixes the issue on our side.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 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.

Half-closed without a request
3 participants