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

bitswap should dht.PutProvider + send to other peers concurrently #424

Closed
jbenet opened this issue Dec 9, 2014 · 5 comments
Closed

bitswap should dht.PutProvider + send to other peers concurrently #424

jbenet opened this issue Dec 9, 2014 · 5 comments
Milestone

Comments

@jbenet
Copy link
Member

jbenet commented Dec 9, 2014

6a5b1e8#commitcomment-8854272

@jbenet
Copy link
Member Author

jbenet commented Jan 15, 2015

This is sort of done, it's now async-rate-limited, but these should be totally separate. an ipfs add -r <hash> should never be block by the network.

@jbenet jbenet added this to the α milestone Jan 15, 2015
@jbenet jbenet assigned jbenet and unassigned jbenet Jan 15, 2015
@btc
Copy link
Contributor

btc commented Jan 17, 2015

Wanna get this full-async for the alpha?

edit: yes

@btc btc self-assigned this Jan 17, 2015
@jbenet jbenet assigned btc and unassigned btc Jan 17, 2015
@whyrusleeping
Copy link
Member

This is kinda tricky, since we run the risk of exploding the number of goroutines running if our network is slow. One option would be to wait until the add has completed to start sending provides messages, but that would prevent streaming from ever happening... One idea would be to buffer up provides that need to happen, and just let them pile up in a slice in a separate 'ProvideBuffer' goroutine, and have that goroutine pull them off and provide as the network allows.

@jbenet
Copy link
Member Author

jbenet commented Jan 20, 2015

Yeah the goroutine count of all these operations should be rate-limited, but that doesnt mean they cant be fully async. Yep, as you describe, buffering the provides and sends, and letting those processes handle them as needed. This is similar to the add->provide need for async.

@btc
Copy link
Contributor

btc commented Jan 20, 2015

buffer up provides that need to happen, and just let them pile up in a slice in a separate 'ProvideBuffer' goroutine, and have that goroutine pull them off and provide as the network allows.

buffering into slice'll definitely save us on RAM. I think we're on the same page. I can whip up something this evening and ping you to get your advice on some of the tricky details.

@btc btc added the status/in-progress In progress label Jan 20, 2015
@btc btc closed this as completed in 4319129 Jan 22, 2015
@btc btc removed the status/in-progress In progress label Jan 22, 2015
@jbenet jbenet unassigned btc Mar 30, 2015
@aschmahmann aschmahmann mentioned this issue Aug 23, 2021
62 tasks
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
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

No branches or pull requests

3 participants