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 race when stream.Read and CancelRead are called concurrently #3241

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

marten-seemann
Copy link
Member

This is an alternative to #3240, moving the lock logic into the flow controller.
It also adds an integration test that is able to reliably reproduce the race condition.

Fixes #3239. Closes #3240.

@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #3241 (fbc30cd) into master (8906148) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3241      +/-   ##
==========================================
+ Coverage   85.43%   85.45%   +0.01%     
==========================================
  Files         133      133              
  Lines        9803     9806       +3     
==========================================
+ Hits         8375     8379       +4     
+ Misses       1053     1052       -1     
  Partials      375      375              
Impacted Files Coverage Δ
internal/flowcontrol/stream_flow_controller.go 100.00% <100.00%> (ø)
internal/utils/rand.go 75.00% <0.00%> (+12.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8906148...fbc30cd. Read the comment docs.

@marten-seemann marten-seemann merged commit be68f7f into master Aug 5, 2021
@marten-seemann marten-seemann deleted the fix-stream-cancel-read-race branch August 10, 2021 13:58
@aschmahmann aschmahmann mentioned this pull request Aug 23, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

race condition when stream.Read and CancelRead are called concurrently
2 participants