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

protocol: fixed deadline datarace #86 #87

Merged
merged 2 commits into from
Mar 2, 2022
Merged

Conversation

mschneider82
Copy link
Contributor

Fixed the race by using atomic.Value instead of unprotected time.Time

It was nessasarry to restructure the Conn struct because of this:

struct of size 80 could be 72 (fieldalignment)

@coveralls
Copy link

coveralls commented Mar 1, 2022

Coverage Status

Coverage increased (+0.02%) to 95.563% when pulling b4887c1 on mschneider82:master into 2e44d7a on pires:main.

@pires
Copy link
Owner

pires commented Mar 1, 2022

Thanks @mschneider82! Could you please turn on race mode for testing to prove this works (as it looks it does)?

@pires
Copy link
Owner

pires commented Mar 1, 2022

@pires pires added this to the 0.6 milestone Mar 1, 2022
@mschneider82
Copy link
Contributor Author

I have added a nil check for atomic.Value with default time.Time{} (no deadline timeout) because TestPassthrough failed. In case no deadline was set

@mschneider82
Copy link
Contributor Author

mschneider82 commented Mar 1, 2022

@pires i have tested it local with -race on. i will add -race to github actions

@mschneider82
Copy link
Contributor Author

done, ready for review & merge

Copy link
Owner

@pires pires left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @mschneider82!

@pires pires merged commit db39a71 into pires:main Mar 2, 2022
@pires pires mentioned this pull request Mar 2, 2022
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.

None yet

3 participants