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

READY: Cherry-picked release-7.5 SyncChannels target_peers fix #5738

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

qstokkink
Copy link
Contributor

This was part of the fixes on release-7.5, but apparently it did not make its way into devel:

self.ipv8.strategies.append((SyncChannels(self.gigachannel_community), -1))

@qstokkink qstokkink marked this pull request as ready for review November 20, 2020 10:33
@qstokkink qstokkink changed the title Cherry-picked release-7.5 SyncChannels target_peers fix READY: Cherry-picked release-7.5 SyncChannels target_peers fix Nov 20, 2020
@sonarcloud
Copy link

sonarcloud bot commented Nov 20, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.1% 0.1% Duplication

@ichorid ichorid merged commit d89f5ca into Tribler:devel Nov 20, 2020
@@ -104,7 +104,7 @@ class PopularityCommunityLauncher(IPv8CommunityLauncher):
@overlay('tribler_core.modules.metadata_store.community.gigachannel_community', 'GigaChannelCommunity')
@kwargs(metadata_store='session.mds', notifier='session.notifier')
@walk_strategy('ipv8.peerdiscovery.discovery', 'RandomWalk')
@walk_strategy('tribler_core.modules.metadata_store.community.sync_strategy', 'SyncChannels')
@walk_strategy('tribler_core.modules.metadata_store.community.sync_strategy', 'SyncChannels', target_peers=-1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have a corresponding const for -1 to clarify what exactly is meant by -1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have two variations for you:

a) A -1 constant:

NEVER_ENOUGH = -1
 ...
@walk_strategy('tribler_core.modules.metadata_store.community.sync_strategy', 'SyncChannels',
               target_peers=NEVER_ENOUGH)

b) A dict mapping:

NEVER_STOP = {'target_peers': -1}
 ...
@walk_strategy('tribler_core.modules.metadata_store.community.sync_strategy', 'SyncChannels',
               **NEVER_STOP)

I am also open to other naming of the variable - please let me know what you prefer. At any rate, I'm not the right person to pick the variable name: I'm way too accustomed to -1 and the inner workings of IPv8.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you, @qstokkink! Both variants look very attractive.
I'm personally like the first one more than the second one.

About the name, maybe something from:

INFINITE = -1
ENDLESS = -1 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

INFINITE = -1 would be the most natural option then to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One moment, I'll make a PR.

@qstokkink qstokkink deleted the fix_backport branch November 20, 2020 12:10
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.

None yet

3 participants