This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
feat(messagequeue): rebroadcast wantlist #106
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
ghost
assigned hannahhoward
Apr 4, 2019
Stebalien
suggested changes
Apr 4, 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.
This is going to have some overhead but it's probably fine. One nit but this otherwise looks good to me.
messagequeue/messagequeue.go
Outdated
func (mq *MessageQueue) SetRebroadcastInterval(delay time.Duration) { | ||
mq.rebroadcastIntervalLk.Lock() | ||
mq.rebroadcastInterval = delay | ||
mq.rebroadcastTimer.Reset(delay) |
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.
We should probably check if rebroadcastTimer
is nil here.
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.
good point.
Make sure rebroadcast timer doesn't get reset if it's nil
Stebalien
approved these changes
Apr 5, 2019
|
timing on test was failure prone, corrected
Test failure is ipfs/boxo#99. |
Thanks! |
Jorropo
pushed a commit
to Jorropo/go-libipfs
that referenced
this pull request
Jan 26, 2023
…tlist feat(messagequeue): rebroadcast wantlist This commit was moved from ipfs/go-bitswap@2c47a55
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Goals
Provide a failsafe to losing wants on other end by rebroadcasting a wantlist every thirty seconds
Implementation
Every peer messagequeue has a rebroadcast timer, which, when it expires, resends all the wants. On the other hand, existing logic in the decision engine will dedup these wants if they are already queued up (see peer request queue)
For discussion
What's the right interval? I set 30 seconds as a start --- seems long enough to so that there won't be a ton of new network traffic, but short enough that a lost want doesn't mean a super extra long recovery
Do we need something smarter? Or is just rebroadcasting at a regular interval ok? I would be inclined to try this to start, and do something smarter (like rebroadcast if wants sit on the list a long time) later.
fix #99, fix #65