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

merkledag: add a concurrency limit to merkledag fetch graph #3495

Merged
merged 1 commit into from
Dec 10, 2016

Conversation

whyrusleeping
Copy link
Member

This should help solve a few 'cant pin giant things' issues.

License: MIT
Signed-off-by: Jeromy why@ipfs.io

@whyrusleeping whyrusleeping added the status/in-progress In progress label Dec 9, 2016
@whyrusleeping whyrusleeping added this to the ipfs 0.4.5 milestone Dec 9, 2016
@whyrusleeping whyrusleeping requested review from a user and Kubuxu December 9, 2016 23:20
@@ -458,8 +458,13 @@ func fetchNodes(ctx context.Context, ds DAGService, in <-chan []*cid.Cid, out ch
close(out)
}()

rateLimit := make(chan struct{}, 8)
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to have this magic number extracted and documented.

Copy link
Member Author

Choose a reason for hiding this comment

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

FIIINE.

// Eight is 2 to the third power, alternatively it can be represented as 7+1, or the cube root of 512
var Eight = 8

Copy link

@ghost ghost Dec 10, 2016

Choose a reason for hiding this comment

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

It's also what you get when you multiply a random number with two!

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
@whyrusleeping whyrusleeping merged commit 93c9002 into master Dec 10, 2016
@whyrusleeping whyrusleeping deleted the fix/fetch-graph-concurrency branch December 10, 2016 19:21
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Dec 10, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
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.

2 participants