-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support unannounce, move to maxAge instead of timeslotting #45
base: master
Are you sure you want to change the base?
Conversation
Forgot to mention, I was gonna add tests, if we wanna land this of course |
I like the idea a lot. |
@prdn yea, and with unannounce we can unannounce a bad service manually, assuming you are on the box with the same hostname, so we might want to add an cli that could that that. most of the time services would unannounce gracefully as well, so the 2-5 min failure scenario is only a problem when something has a catastrophic failure. will still happen but less likely |
@mafintosh @robertkowalski wondering if we can remove the timeslot all together. |
@prdn good point! talked to @mafintosh, basically that was the intention, but the maxAge option in bittorrent dht was not used. added it in webtorrent/bittorrent-dht#186 |
@robertkowalski can you open a separate PR for Grape, to allow the configuration of the maxAge parameter for PeerStore (also in the command line version)? |
sure! had to add tests, will do when the patch landed in dht master |
@@ -45,7 +45,8 @@ class Grape extends Events { | |||
host: this.conf.host || false, | |||
bootstrap: this.conf.dht_bootstrap, | |||
timeBucketOutdated: this.conf.dht_nodeLiveness, | |||
verify: crypto.verify | |||
verify: crypto.verify, | |||
maxAge: this.conf.timeslot |
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.
@mafintosh can we call this dht_timeslot
or dht_peer_maxAge
?
edit: I'm referring to this.conf.timeslot
that should be renamed into dht_peer_maxAge
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.
@mafintosh would be cool to support it as parameter here https://github.com/bitfinexcom/grenache-grape/blob/master/bin/grape.js
Implements support for distributed unannounce using webtorrent/bittorrent-dht#184 which means that services when shutting down gracefully can tell the DHT to unannounce itself (NOTE: if we want to land this, we shouldn't merge it until the DHT pr has landed most likely).
Also moves the timeslotting behaivor to use maxAge instead, since this is the intended use of that.
If you want I can split up the PR in two parts, one for timeslotting and one for unannounce, but the two go nicely hand in hand.
If we land unannounce, I suggest we increase the default timeslot to something more like 2-5 min, since services most of the time will be able to unannounce themself, so there will be less dead nodes in the dht. This should drastically reduce the announce traffic on the dht
The link client PR that allows a link to unannounce is here, bitfinexcom/grenache-nodejs-link#10
Let me know what you think :)