ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 44 forks source link

fix(p2p): fix stall timer checks #2015

Closed sangaman closed 3 years ago

sangaman commented 3 years ago

This fixes a regression introduced in #1994 that prevents enabling the stall timer for peers that checks whether peers are not responding to our packets in a reasonable timeframe and disconnecting those that are not. Without these checks, peers that have gone offline may remain in the list of connected peers, resulting in unexpected behavior and also preventing those peers from establishing new connections with us once they come back online.

Closes #2010.

I'm also hoping, but can't say for sure, that this fixes the test flakiness case that arose recently described here https://github.com/ExchangeUnion/xud/issues/1771#issuecomment-732289609.

LePremierHomme commented 3 years ago

Sorry, my bad!

sangaman commented 3 years ago

Sorry, my bad!

It happens! I overlooked it too when reviewing. I'm thinking a bit about a good regression test to add in to prevent such a regression in the future, it's a bit awkward because we'd need to wait 5-10 seconds for the stall timer to kick in which is a bit long of a delay for the test, but maybe I can reduce the delay without messing with any of the key functionality.