Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

delay finding providers #17

Merged
merged 1 commit into from
Oct 23, 2018
Merged

delay finding providers #17

merged 1 commit into from
Oct 23, 2018

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Oct 22, 2018

It's expensive and causes quite a bit of dialing. Let's give bitswap a second to work it's magic before we try this.

fixes #16

work towards fixing ipfs/kubo#5613

@ghost ghost assigned Stebalien Oct 22, 2018
@ghost ghost added the status/in-progress In progress label Oct 22, 2018
@Stebalien
Copy link
Member Author

This feels a bit heavy-handed but it should help. Thoughts @whyrusleeping?

bitswap.go Outdated
// NB: Optimization. Assumes that providers of key[0] are likely to
// be able to provide for all keys. This currently holds true in most
// every situation. Later, this assumption may not hold as true.
bs.findKeys <- &blockRequest{
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we select on ctx.Done() here just in case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I ended up just reworking this patch to move sending the findProvs request to the main select. This also means we can abort this if we end up getting the block before the send completes (should help under heavy load).

It's expensive and causes quite a bit of dialing. Let's give bitswap a second to
work it's magic before we try this.

fixes #16
Copy link
Contributor

@schomatis schomatis left a comment

Choose a reason for hiding this comment

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

LGTM

@Stebalien Stebalien merged commit a2ce7a2 into master Oct 23, 2018
@ghost ghost removed the status/in-progress In progress label Oct 23, 2018
Jorropo pushed a commit to Jorropo/go-libipfs that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid calling FindProviders
2 participants