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

Potential for race condition in bitswap #3274

Closed
whyrusleeping opened this issue Sep 30, 2016 · 4 comments
Closed

Potential for race condition in bitswap #3274

whyrusleeping opened this issue Sep 30, 2016 · 4 comments
Labels
need/analysis Needs further analysis before proceeding

Comments

@whyrusleeping
Copy link
Member

Making this issue to track a potential race condition in bitswap. When adding a block to bitswap, the incoming block is passed through to the notifications lib and published to anyone waiting for that block. In the case that someone has called GetBlock on the block and then we add it locally, two different goroutines would have the same 'block'. This is only a problem in cases where we mutate the node on the adders side after the add call.

Doing a simple ipfs cat h(X) in one shell before h(X) exists, and then running ipfs add X does not even trigger the race detector.

@Kubuxu Kubuxu added the need/analysis Needs further analysis before proceeding label Nov 28, 2016
@whyrusleeping
Copy link
Member Author

@Stebalien I think we fixed this issue recently, right?

@magik6k
Copy link
Member

magik6k commented Sep 2, 2017

ref #4169, looks fixed

@Stebalien
Copy link
Member

I think this is a non-issue and unrelated. This appears to be about returning the same block object to multiple clients which should be totally fine (they're immutable (well, we copy before mutating at least).

@eingenito
Copy link
Contributor

Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/analysis Needs further analysis before proceeding
Projects
None yet
Development

No branches or pull requests

5 participants