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

Fix a big source of races in CHTTP2 code #20139

Merged
merged 3 commits into from
Aug 31, 2019
Merged

Conversation

yashykt
Copy link
Member

@yashykt yashykt commented Aug 30, 2019

Replace direct closure callback calls with GRPC_CLOSURE_SCHED.

This was probably causing a huge lot of bugs in our codebase.

  1. Since the closures can be those from combiners, we were running closures outside of combiners by running the callback function directly. This would cause all sorts of races in the chttp2 code.

  2. Closure callback functions do not consume a ref to the error that is passed in. The error is instead consumed by the scheduler. By directly calling the callback function, we would also be leaking errors.

Fixes #19901, #18885, #18944.
Potentially also fixes #18942, #18941, #18884

@yashykt yashykt changed the title Replace direct closure callback calls with GRPC_CLOSURE_SCHED Fix a big source of races in CHTTP2 code Aug 30, 2019
@yashykt yashykt added release notes: yes Indicates if PR needs to be in release notes lang/c++ labels Aug 30, 2019
@yashykt yashykt requested a review from rmstar August 30, 2019 22:21
Copy link
Contributor

@rmstar rmstar left a comment

Choose a reason for hiding this comment

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

lgtm. thanks for fixing this!

@yashykt
Copy link
Member Author

yashykt commented Aug 31, 2019

Issues : #20081, #19726

@yashykt yashykt merged commit 41771f2 into grpc:master Aug 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 29, 2019
@yashykt yashykt deleted the fixraces branch May 18, 2023 19:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang/c++ release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASAN failure: CFStreamTest/CFStreamTest.NetworkFlapRpcsInFlight/7 Abort in remove_stream
2 participants