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

Fix various IPNS issues #4440

Merged
merged 5 commits into from
Dec 1, 2017
Merged

Fix various IPNS issues #4440

merged 5 commits into from
Dec 1, 2017

Conversation

Stebalien
Copy link
Member

Found while looking into: https://discuss.ipfs.io/t/ipfs-name-failing-to-resolve/1524

  1. Fix the republish docs. We republish every 4 hours by default.
  2. Republish after 1min on start. The 1min delay gives us time to start up everything else but ensures that the IPNS record becomes resolvable quickly if we've been offline for a while.
  3. Republish every 5min when republishing fails. I doubt this will cost us that much bandwidth/CPU usage and will ensure that IPNS will continue working properly even if the node is intermittently offline.

We republish every 4 hours, not 12.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
(after a delay of 1 minute)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This way, if we *happen* to be offline while attempting a publish, we don't wait
the full interval.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
(makes code climate happy)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@ghost ghost assigned Stebalien Nov 29, 2017
@ghost ghost added the status/in-progress In progress label Nov 29, 2017
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
defer tick.Stop()
timer := time.NewTimer(InitialRebroadcastDelay)
defer timer.Stop()
if rp.Interval < InitialRebroadcastDelay {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this defeat the purpose of the initial delay?
I think we should simply tick with the InitialRebroadcastDelay unconditionally here.

Copy link
Member Author

Choose a reason for hiding this comment

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

The initial delay is usually much shorter than the interval. If the user asks us to, e.g., publish every 10s, IMO, we should do that regardless of the initial delay (at the moment, not doing that would break the tests).

Alternatively, we could make the initial delay configurable (but that's one more knob).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that's reasonable -- no need to have another knob for this.

@whyrusleeping whyrusleeping merged commit bc71242 into master Dec 1, 2017
@ghost ghost removed the status/in-progress In progress label Dec 1, 2017
@whyrusleeping whyrusleeping deleted the fix/ipns-repub branch December 1, 2017 16:30
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.

3 participants