Open reardonia opened 2 weeks ago
See what you think.
diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h
index 7c0b4915c..a32c80be5 100644
--- a/libtransmission/peer-mgr.h
+++ b/libtransmission/peer-mgr.h
@@ -207,9 +207,16 @@ public:
if (is_connected_)
{
- num_consecutive_fails_ = {};
piece_data_at_ = {};
}
+ else if (piece_data_at_ != time_t{})
+ {
+ num_consecutive_fails_ = {};
+ }
+ else
+ {
+ on_connection_failed();
+ }
}
[[nodiscard]] constexpr auto is_connected() const noexcept
We need to keep these seeds in the candidate list, and somehow discourage ourselves from trying them. Or else, we will rediscover these peers from trackers and whatnot sooner or later, then find ourselves trying them again.
The above patch deprioritises the peer candidate further and further every time a connection was established, but no piece data was transferred. Hopefully this will help bring the swarm to a equilibrium where most connection attempts amount to something.
What is the issue?
Testing on Tr4 mainline.
related loosely to #6909 , when peers are removed due to connection error (handshake occured, but was terminated when one side or the other thinks both are seeds), an attempt is immediately made to reconnect. The peer is removed from active swarm but kept on the candidate atom list. This means the peer is retried endlessly, once every reconnect_pulse().
Which application of Transmission?
transmission-daemon
Which version of Transmission?
Tr4 mainline