-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Merged by Bors] - sync2: multipeer: fix edge cases #6447
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ca2d5c6
sql: add Database.Connection/WithConnection, interface cleanup
ivan4th 6e3aa16
sync2: dbset: use single connection for each sync session
ivan4th eff6963
sync2: multipeer: fix edge cases
ivan4th 4984889
sync2: dbset: fix connection leak in non-loaded DBSets
ivan4th bb31cc6
sql: revert removing Rollback method of the Migration interface
ivan4th 3e5a401
sql: remove Database.Connection() method, keep WithConnection()
ivan4th 2753560
Merge branch 'feature/long-db-conns' into sync2/dbset-conns
ivan4th f5cae06
sql: allow multiple connections to in-memory database
ivan4th 9e585e5
sync2: fixup for temporary OrderedSet copies
ivan4th 042d0d7
Merge branch 'sync2/dbset-conns' into sync2/fix-multipeer
ivan4th 0914f1f
Merge branch 'develop' into sync2/dbset-conns
ivan4th 4ac694b
Merge branch 'sync2/dbset-conns' into sync2/fix-multipeer
ivan4th 24768fb
Merge branch 'develop' into sync2/fix-multipeer
ivan4th 989dc18
Merge branch 'develop' into sync2/fix-multipeer
ivan4th File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I'm a bit confused by this interval calculation. Would it be simpler if
SyncIntervalSpread
would be defined astime.Duration
and gave the maximum deviation from the interval?This will uniformly generate a duration between
[SyncInterval, SyncInterval+SyncIntervalSprad)
while the current definition is[SyncInterval, SyncInterval+2*SyncIntervalSpread)
which is a bit odd to me?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.
The idea was for
SyncIntervalSpread
to be a floating point number0..1
and to have intervals between[SyncInterval - SyncInterval*SyncIntervalSpread, SyncInterval + SyncInterval*SyncIntervalSpread]
We could of course also use
MinSyncInterval
andMaxSyncInterval
, but I'm not sure which is more convenient.My idea was that if I e.g. want the actual sync interval to be uniformly spread across
SyncInterval +/- 25%
I just setSyncIntervalSpread
to0.25
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.
Maybe I should reflect this simpler explanation in the comments, incl. godoc comments for the config struct
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.
I would prefer the
Min-
andMax-
config options, but if you think a fractional spread is easier then go for that. But please add some explanation - to the config and/or here - what the values mean 🙂