-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Addrman offline attempts #8065
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
Addrman offline attempts #8065
Conversation
|
This should probably be checking for connections to at least two netgroups outside of RFC1918 IP space, but this is certainly an improvement. |
|
@pstratem checking connections is better than no check at all. This PR is from April 2015, so I'm not inclined to expand the scope any further right now. If this is accepted I'll happily open a follow on PR to make it stronger. |
|
Can one of the admins verify this patch? |
|
Needs rebase. |
|
Did you accidentally include #7992? |
|
utACK 66cefd47194a8aa7478dbea9a1b96640febeeda7 |
If a node is offline failed outbound connection attempts will crank up the addrman counter and effectively blow away our state. This change reduces the problem by only counting attempts made while the node believes it has outbound connections to at least two netgroups. Connect and addnode connections are also not counted, as there is no reason to unequally penalize them for their more frequent connections -- though there should be no real effect from this unless their addnode configureation is later removed. Wasteful repeated connection attempts while only a few connections are up are avoided via nLastTry. This is still somewhat incomplete protection because our outbound peers could be down but not timed out or might all be on 'local' networks (although the requirement for multiple netgroups helps).
This slows the increase of the nAttempts in addrman while partitioned, even if the node hasn't yet noticed the partitioning.
|
This should be easy to test manually: add a debug log entry above the info.nAttempts increment in CAddrMan::Attempt_(), and see how often it triggers with network connected and disconnected. |
|
utACK 6182d10 |
Since we merged core PR #8065 a new bool parameter has been added to such function. if false we avoid the book keeping of connections failed attempt. This will happen in the followin cases: - node is offline - node connect to less than 2 netgroups via outound conns - connect(s) and addnode(s)
Since we merged core PR #8065 a new bool parameter has been added to such function. if false we avoid the book keeping of connections failed attempt. This will happen in the following cases: - node is offline - node connect to less than 2 netgroups via outbound conns - connect(s) and addnode(s)
40e4116 Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell) b988ce6 Avoid counting failed connect attempts when probably offline. (Gregory Maxwell) Pull request description: Backport of bitcoin#8065 > If a node is offline failed outbound connection attempts will crank up > the addrman counter and effectively blow away our state. > > This change reduces the problem by only counting attempts made while > the node believes it has outbound connections to at least two > netgroups. > > Connect and addnode connections are also not counted, as there is no > reason to unequally penalize them for their more frequent > connections -- though there should be no real effect from this > unless their addnode configureation is later removed. > > Wasteful repeated connection attempts while only a few connections are > up are avoided via nLastTry. > > This is still somewhat incomplete protection because our outbound > peers could be down but not timed out or might all be on 'local' > networks (although the requirement for multiple netgroups helps). Note: A future PR will focus on refactoring the layer 2 (masternode) methods to stop using `ConnectNode()` directly ACKs for top commit: random-zebra: ACK 40e4116 furszy: utACK 40e4116 Tree-SHA512: 96adadea1d214a2afcf5e43c13a4409ca3de1d81ae51225bda74eabda6a3435a7678c3826e3c3930e543b084de1f28a4a5a102ccd1e3ad3c01da4937f312941b
40e4116 Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell) b988ce6 Avoid counting failed connect attempts when probably offline. (Gregory Maxwell) Pull request description: Backport of bitcoin#8065 > If a node is offline failed outbound connection attempts will crank up > the addrman counter and effectively blow away our state. > > This change reduces the problem by only counting attempts made while > the node believes it has outbound connections to at least two > netgroups. > > Connect and addnode connections are also not counted, as there is no > reason to unequally penalize them for their more frequent > connections -- though there should be no real effect from this > unless their addnode configureation is later removed. > > Wasteful repeated connection attempts while only a few connections are > up are avoided via nLastTry. > > This is still somewhat incomplete protection because our outbound > peers could be down but not timed out or might all be on 'local' > networks (although the requirement for multiple netgroups helps). Note: A future PR will focus on refactoring the layer 2 (masternode) methods to stop using `ConnectNode()` directly ACKs for top commit: random-zebra: ACK 40e4116 furszy: utACK 40e4116 Tree-SHA512: 96adadea1d214a2afcf5e43c13a4409ca3de1d81ae51225bda74eabda6a3435a7678c3826e3c3930e543b084de1f28a4a5a102ccd1e3ad3c01da4937f312941b
40e41169503533f08f4d1861c3b76a3a0c6226eb Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell) b988ce6d9e99622fcc366a091bd64300fa251a5f Avoid counting failed connect attempts when probably offline. (Gregory Maxwell) Pull request description: Backport of bitcoin/bitcoin#8065 > If a node is offline failed outbound connection attempts will crank up > the addrman counter and effectively blow away our state. > > This change reduces the problem by only counting attempts made while > the node believes it has outbound connections to at least two > netgroups. > > Connect and addnode connections are also not counted, as there is no > reason to unequally penalize them for their more frequent > connections -- though there should be no real effect from this > unless their addnode configureation is later removed. > > Wasteful repeated connection attempts while only a few connections are > up are avoided via nLastTry. > > This is still somewhat incomplete protection because our outbound > peers could be down but not timed out or might all be on 'local' > networks (although the requirement for multiple netgroups helps). Note: A future PR will focus on refactoring the layer 2 (masternode) methods to stop using `ConnectNode()` directly ACKs for top commit: random-zebra: ACK 40e41169503533f08f4d1861c3b76a3a0c6226eb furszy: utACK 40e4116 Tree-SHA512: 96adadea1d214a2afcf5e43c13a4409ca3de1d81ae51225bda74eabda6a3435a7678c3826e3c3930e543b084de1f28a4a5a102ccd1e3ad3c01da4937f312941b # Conflicts: # src/activemasternode.cpp
If a node is offline failed outbound connection attempts will crank up
the addrman counter and effectively blow away our state.
This change reduces the problem by only counting attempts made while
the node believes it has outbound connections to at least two
netgroups.
Connect and addnode connections are also not counted, as there is no
reason to unequally penalize them for their more frequent
connections -- though there should be no real effect from this
unless their addnode configureation is later removed.
Wasteful repeated connection attempts while only a few connections are
up are avoided via nLastTry.
This is still somewhat incomplete protection because our outbound
peers could be down but not timed out or might all be on 'local'
networks (although the requirement for multiple netgroups helps).
( reopen of #6030 )