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 autonat race #1062

Merged
merged 1 commit into from
Mar 2, 2021
Merged

fix autonat race #1062

merged 1 commit into from
Mar 2, 2021

Conversation

willscott
Copy link
Contributor

@willscott willscott commented Feb 27, 2021

fix ipfs/kubo#7947

move BasicHost.AutoNat to a private field (it has no public method and shouldn't be accessed afaik.
Instead add a setter for config that sets it while holding the address mutex to prevent reads of the
field at the same time.

fix #7947
move `BasicHost.AutoNat` to a private field (it has no public method and shouldn't be accessed afaik.
Instead add a setter for config that sets it while holding the address mutex to prevent reads of the
field at the same time.
Copy link
Contributor

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Looks like the only other field read is also safe, since it already holds the addrMu mutex.

Thanks for the quick fix! :)

@Stebalien
Copy link
Member

(someday we'll fix the dependency cycles here)

@willscott willscott merged commit 6a14d8c into master Mar 2, 2021
@willscott willscott deleted the fix/autonatrace branch March 2, 2021 02:08
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 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.

data race on BasicHost.AutoNAT when using fsrepo.Open with core.NewNode
3 participants