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 introduced in bitswap #1474

Merged
merged 1 commit into from
Jul 14, 2015
Merged

fix race introduced in bitswap #1474

merged 1 commit into from
Jul 14, 2015

Conversation

whyrusleeping
Copy link
Member

Doing the publish before the blockstore.Put would cause a race where callers of GetBlock (in tests) would finish, and then immediately try to read the blocks from the blockstore to verify that the block was received, and the block hadnt quite made it to disk yet by the time that call was made.

repro was running:

while go test ./exchange/bitswap -run=TestLargeFile; end

for a few minutes, before the fix would fail within a minute, after the fix, ran for ten minutes before i got bored and killed it.

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@whyrusleeping whyrusleeping added the status/in-progress In progress label Jul 14, 2015
@whyrusleeping
Copy link
Member Author

Note: I would still like to find a way to publish the blocks before they get fully persisted to disk. That process can sometimes be slow and the getting blocks to the user faster allows the entire operation to progress more quickly

@jbenet
Copy link
Member

jbenet commented Jul 14, 2015

whoops

jbenet added a commit that referenced this pull request Jul 14, 2015
fix race introduced in bitswap
@jbenet jbenet merged commit 1795482 into master Jul 14, 2015
@jbenet jbenet removed the status/in-progress In progress label Jul 14, 2015
@jbenet jbenet deleted the fix/bitswap-race branch July 14, 2015 20:24
@jbenet jbenet modified the milestone: IPFS 0.3.6 Jul 28, 2015
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

2 participants