Skip to content

DelayedTransport shutdown race#7743

Closed
YifeiZhuang wants to merge 3 commits intogrpc:masterfrom
ejona86:delayedtransportshutdownrace
Closed

DelayedTransport shutdown race#7743
YifeiZhuang wants to merge 3 commits intogrpc:masterfrom
ejona86:delayedtransportshutdownrace

Conversation

@YifeiZhuang
Copy link
Copy Markdown
Member

@YifeiZhuang YifeiZhuang commented Dec 21, 2020

To fix #6283.
Change to be more explicit and fail fast on ClientStream calls order before and after start(), corresponding to configuration and RPC calls, respectively. This fixes the issue because it guarantees that removing from pendingStream in delayedClientTransport means it is safe to shutdown. If by the time pendingStream is processed, start() has not been called yet, nothing will drain because of the explicit strict call check, and the subsequent calls will directly execute on the realStream. This is guarded in the locking block.

@ejona86 ejona86 force-pushed the delayedtransportshutdownrace branch from f26a501 to 655fef2 Compare December 21, 2020 18:16
YifeiZhuang added a commit that referenced this pull request Dec 21, 2020
…le (#7720)" (#7744)

This reverts commit 9085012.
Alternative solution: alternative #7743
@YifeiZhuang YifeiZhuang changed the title Delayedtransportshutdownrace DelayedTransport shutdown race Dec 22, 2020
Copy link
Copy Markdown
Member Author

@YifeiZhuang YifeiZhuang left a comment

Choose a reason for hiding this comment

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

LGTM.

@YifeiZhuang
Copy link
Copy Markdown
Member Author

Test

@YifeiZhuang
Copy link
Copy Markdown
Member Author

Jump to #7749

dfawley pushed a commit to dfawley/grpc-java that referenced this pull request Jan 15, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 3, 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.

DelayedClientTransport can trigger RejectedExecutionException

2 participants