Closed black-puppydog closed 2 years ago
Thanks! It's very likely an issue with ssb-conn. It's hard for me to reproduce, but I was intending to give some time to ssb-conn this week anyway, so I'll take a look at this one too. One way you could help me is to share your conn.json (I believe there's rarely any private info in that file), that should help me figure out why this is happening to you.
Here it is. I just noticed this stopped since I used an invite for my own pub. But I can trigger this easily by just going to the connections tab (which showed two active pub connections when I tried this) and then manually disconnecting (but not "forgetting") all active connections. If I then launch my phone's manyverse and the two automatically connect, it stops again.
So I'd say this is happening only in situations where there is no connection currently. Which makes it less severe I guess, but still there should be some back-off I guess, and/or a coupling to the OS signalling (un-)availability of general network connectivity. I.e. if there's no net & no bluetooth, don't try to gossip, and if there is, even if you have nobody to speak to, don't try to reconnect over and over if they're not responding.
Ah, GH doesn't let me attach json files?! Okay...
Well, here is a totaly-not-json file: conn.txt
So I'd say this is happening only in situations where there is no connection currently.
Yes, that was my suspicion as well. ssb-conn has logic for "if I can't get a hold on any peer, just keep on trying like mad"
ssb-conn@6.0.0 released just now. I tested with your conn.json file (thanks for it!) and the issue is gone. We now have a retry timer system that's based on how many connection failures have happened with that peer since the last successful connection, so that it follows the formula 4sec + 10sec * Math.min(64, failure || 0)
which I discovered by testing many different values and tweaking the curve.
Can confirm that the retries don't happen anymore now, at least not regularly. :)
I'm running Manyverse desktop and follow some profiles that have pubs following them, so I guess that conn is scheduling those pubs to get updates. However, it seems to not use any back-off mechanism when it fails to reach those pubs. From its startup, I see the following logs showing up every 1-2 seconds, over and over:
As you can see, these are the same peers being scheduled, connections failing for IP or DNS reasons, yet they keep being scheduled again.
Not sure whether this is an issue with ssb-conn or with manyverse...