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

remove unneeded mutex in the client #2798

Merged
merged 1 commit into from
Sep 22, 2020
Merged

Conversation

egonelbre
Copy link
Contributor

@egonelbre egonelbre commented Sep 22, 2020

Fixes #2717.

For s.currentFrame, it seems unlock/lock could be previously used, when it was using separate frame type, however, I don't think it's safe as mentioned in the issue.

In the dial, it's only calling recursively itself the mutex seems unnecessary. I think it was added because of the go func probably causing a race, however that doesn't fix the underlying potential race.

Note, I'm not sure, whether these changes are correct.

@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #2798 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2798      +/-   ##
==========================================
- Coverage   86.02%   86.02%   -0.00%     
==========================================
  Files         133      133              
  Lines       12071    12069       -2     
==========================================
- Hits        10384    10382       -2     
  Misses       1355     1355              
  Partials      332      332              
Impacted Files Coverage Δ
client.go 76.22% <ø> (-0.33%) ⬇️

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 27448c1...60bec77. Read the comment docs.

@egonelbre egonelbre changed the title ensure s.currentFrame is protected by s.mutex Fixes for 2717 Sep 22, 2020
@egonelbre egonelbre force-pushed the fix branch 3 times, most recently from 8ae6615 to d8a7a74 Compare September 22, 2020 12:04
Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

See comment.

receive_stream.go Outdated Show resolved Hide resolved
@marten-seemann marten-seemann changed the title Fixes for 2717 remove unneeded mutex in the client Sep 22, 2020
Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

LGTM now. It looks like we don't need the mutex in the client any more, so this is a nice simplification.
Thank you @egonelbre!

@marten-seemann marten-seemann merged commit d44f454 into quic-go:master Sep 22, 2020
@egonelbre egonelbre deleted the fix branch September 22, 2020 13:33
@aschmahmann aschmahmann mentioned this pull request Feb 18, 2021
73 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.

Possible data race: A field in a structure is sometimes protected by Mutex, but sometimes unprotected.
2 participants