Commit Graph

7 Commits

Author SHA1 Message Date
Steven Allen
e10289a93d fix: really cap the max backoff at 10 minutes
While preserving some randomness.

And add a test.
2020-05-25 21:20:23 -07:00
Steven Allen
17b3b02549 fix: remove unecessary context 2020-05-25 21:20:23 -07:00
Steven Allen
87a293f680 fix(peering): fix a race condition 2020-05-25 21:20:23 -07:00
Steven Allen
fe2b289d30 test: add unit test for peering service 2020-05-25 21:20:20 -07:00
Steven Allen
0551c4dca8 fix: address peering service code feedback
* better name for timer
* cancel context from within stop
2020-05-25 20:24:43 -07:00
Steven Allen
8e52c7fb2d fix: doc comment location
Co-authored-by: Will <will.scott@protocol.ai>
2020-05-25 20:24:43 -07:00
Steven Allen
978091a626 feat: implement peering service
MVP for #6097

This feature will repeatedly reconnect (with a randomized exponential backoff)
to peers in a set of "peered" peers.

In the future, this should be extended to:

1. Include a CLI for modifying this list at runtime.
2. Include additional options for peers we want to _protect_ but not connect to.
3. Allow configuring timeouts, backoff, etc.
4. Allow groups? Possibly through textile threads.
5. Allow for runtime-only peering rules.
6. Different reconnect policies.

But this MVP should be a significant step forward.
2020-05-25 20:24:41 -07:00