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

move findproviders out of critical path #1290

Merged
merged 5 commits into from
May 31, 2015
Merged

move findproviders out of critical path #1290

merged 5 commits into from
May 31, 2015

Conversation

whyrusleeping
Copy link
Member

This PR makes bitswap really fast. but the organization is a bit weird, some feedback would be nice

@whyrusleeping whyrusleeping added the status/in-progress In progress label May 25, 2015
@whyrusleeping
Copy link
Member Author

It looks like the reprovider worker needs to move into the wantmanager... i dont want to have to lock around the wantlist to protect that.

@whyrusleeping whyrusleeping changed the title trying to figure out this bitswap thing move findproviders out of critical path May 25, 2015
@whyrusleeping
Copy link
Member Author

thinking about this some more, bitswap needs to have a way to decide when it needs to connect to providers for a given key on its wantlist. This isnt simple to do...

@whyrusleeping whyrusleeping mentioned this pull request May 26, 2015
49 tasks
@whyrusleeping
Copy link
Member Author

interesting batch of failures here... indicating i've done something wrong

bs.counterLk.Lock()
bs.blocksRecvd++
if has, err := bs.blockstore.Has(block.Key()); err == nil && has {
has, err := bs.blockstore.Has(block.Key())
if err == nil && has {
Copy link
Contributor

Choose a reason for hiding this comment

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

i think the error is dropped here.

Copy link
Member Author

Choose a reason for hiding this comment

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

right you are. not sure what should be done with one should it arrive though...

Copy link
Member

Choose a reason for hiding this comment

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

probably depends on the error?

i think we have crappy reproviding atm. in general we don't do a good job of advertising out what we mean to advertise.

@whyrusleeping
Copy link
Member Author

This PR moves the addition of new blocks to our wantlist (and their subsequent broadcast to the network) outside of the clientWorker loop. This allows blocks to more quickly propogate to peers we are already connected to, where before we had to wait for the previous findProviders call in clientworker to complete before we could notify our partners of the next blocks that we want. I then changed the naming of the clientWorker and related variables to be a bit more appropriate to the model. Although the clientWorker (now named providerConnector) feels a bit awkward and should probably be changed.

@jbenet
Copy link
Member

jbenet commented May 27, 2015

@whyrusleeping thanks for the summary, that SGTM.

@whyrusleeping
Copy link
Member Author

in the future, ill do writeups like that for all my PRs, its helpful for everyone (myself included)

@jbenet
Copy link
Member

jbenet commented May 27, 2015

@whyrusleeping we should put them in the commits so available with the history.

@whyrusleeping whyrusleeping force-pushed the feat/bitswap-speed branch 4 times, most recently from 9bf678c to db8af56 Compare May 29, 2015 17:02
@jbenet
Copy link
Member

jbenet commented May 29, 2015

@whyrusleeping going to need to squash db8af56 somewhere. then try running gpe

git checkout master
git pull origin master
git checkout feat/bitswap-speed
git cherry master | git push-each

maybe can do:

git fetch origin
git cherry origin/master | git push-each

https://github.com/jbenet/git-push-each

This PR moves the addition of new blocks to our wantlist (and their
subsequent broadcast to the network) outside of the clientWorker loop.
This allows blocks to more quickly propogate to peers we are already
connected to, where before we had to wait for the previous findProviders
call in clientworker to complete before we could notify our partners of
the next blocks that we want. I then changed the naming of the
clientWorker and related variables to be a bit more appropriate to the
model. Although the clientWorker (now named providerConnector) feels a
bit awkward and should probably be changed.

fix test assumption
jbenet added a commit that referenced this pull request May 31, 2015
move findproviders out of critical path
@jbenet jbenet merged commit b5bd29a into master May 31, 2015
@jbenet jbenet removed the status/in-progress In progress label May 31, 2015
@jbenet jbenet deleted the feat/bitswap-speed branch May 31, 2015 21:30
@wking wking mentioned this pull request Jun 12, 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.

3 participants