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

Optimise pinging #203

Merged
merged 7 commits into from Feb 21, 2019
Merged

Conversation

BeaudanBrown
Copy link

@BeaudanBrown BeaudanBrown commented Feb 18, 2019

Refactored the pinging logic to handle a couple edge cases better
Ttl for online broadcast messages is now only 1 min
More sensible variable names for ping related things
Now ping our contacts that go offline every 2 mins to check if they are back online
Ping our contacts if they sent us a storage server message in the last 2 mins

Along the way I stumbled across a couple bugs in the snode logic that would cause the nodes to always be removed on the first error rather than trying 3 times, and changed the logging to print a warning for the first 2 failures of a snode and then an error when it is removed from memory

Although I didn't end up actually doing a debounce for the pings (because it would have made the system less reliable), this resolves #191
Also fixes #192

Tried a bunch and considered heaps of different stuff during this PR, still not happy with the pinging but I think the nature of the architecture means we are just going to have to accept that the online indicator won't always be very accurate

js/modules/loki_p2p_api.js Outdated Show resolved Hide resolved
Copy link

@sachaaaaa sachaaaaa left a comment

Choose a reason for hiding this comment

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

Looks good!

@sachaaaaa sachaaaaa merged commit 888d5f1 into oxen-io:development Feb 21, 2019
@BeaudanBrown BeaudanBrown deleted the optimise-pinging branch February 21, 2019 03:36
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.

P2P does not recover after 1 failed message Add debounce for pings
3 participants