-
Notifications
You must be signed in to change notification settings - Fork 233
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 and simplify some bootstrapping logic #405
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Stebalien
commented
Nov 5, 2019
•
edited
Loading
edited
- Don't bootstrap more than 16 buckets: We can't generate target IDs in buckets beyond bucket 15 so there's no point.
- Bootstrap sequentially: The default timeout is 10s so this won't take that long anyways. On the other hand, if we do this all at once, we max the swarms dial queue.
- Rename triggerAutoBootstrap to autoBootstrap. This variable used to control triggering only but now completely disables automatic bootstrapping.
- Remove the BootstrapConfig. We introduced this before we switched to functional options. Now that we're breaking the interfaces anyways, we might as well use functional options all the way (easier to extend).
- Always query self when bootstrapping. This really isn't that expensive and ensures that we know how many buckets we should bootstrap.
- Don't abort the bootstrap process if we timeout finding ourselves.
- Rename bootstrap to refresh everywhere as these aren't really the same thing (pointed out by @raulk).
Stebalien
force-pushed
the
feat/simplify-bootstrapping
branch
from
November 5, 2019 22:29
e765a27
to
ac48b5e
Compare
* Rename triggerAutoBootstrap to autoBootstrap. This variable used to control _triggering_ only but now completely disables automatic bootstrapping. * Remove the BootstrapConfig. We introduced this before we switched to functional options. Now that we're breaking the interfaces anyways, we might as well use functional options all the way (easier to extend). * Always query self (feedback from @raulk). * Important: don't abort the bootstrap process if we timeout finding ourselves.
The default timeout is 10s so this won't take that long anyways. On the other hand, if we do this all at once, we max the swarms dial queue.
We can't generate target IDs in buckets beyond bucket 15 so there's no point.
Stebalien
force-pushed
the
feat/simplify-bootstrapping
branch
from
November 5, 2019 22:34
ac48b5e
to
71c05a8
Compare
@Stebalien Great stuff. Do you need help with this ? |
Nah, I'm just trying to handle some last minute review from raul so we can cut a release. |
Actually, if you have some time, a review would be great! |
raulk
reviewed
Nov 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for what seems like a concurrency bug and a few nits.
As pointed out by raul, bootstrapping and refreshing are not the same thing. Bootstrapping is the initial setup (i.e., connect to some initial nodes to get started). Refreshing is the process of refreshing the routing table.
Stebalien
force-pushed
the
feat/simplify-bootstrapping
branch
from
November 5, 2019 23:34
2b2ab45
to
ef31967
Compare
raulk
approved these changes
Nov 5, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.