net: don’t retry failed oneshot connections forever #12329

pull theuni wants to merge 1 commits into bitcoin:master from theuni:no-infinite-oneshot changing 2 files +8 −11
  1. theuni commented at 7:10 pm on February 1, 2018: member

    As introduced by (my suggestion, sorry, in) #11512, failed dns resolves end up as oneshots. But failed oneshots are re-added as oneshots, so we need to make sure that we’re not queuing these up forever after failed resolves.

    Rather than trying to differentiate, I think we should just not re-add failed oneshots and be done with it.

    Maybe @sipa can shed a light on what the original intention was.

  2. net: don't retry failed oneshot connections forever 660f5f19ae
  3. laanwj added this to the milestone 0.16.0 on Feb 1, 2018
  4. laanwj added the label P2P on Feb 1, 2018
  5. in src/net.cpp:1955 in 660f5f19ae
    1951@@ -1953,29 +1952,29 @@ void CConnman::ThreadOpenAddedConnections()
    1952 }
    1953 
    1954 // if successful, this moves the passed grant to the constructed node
    1955-bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot, bool fFeeler, bool manual_connection)
    1956+void CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot, bool fFeeler, bool manual_connection)
    


    laanwj commented at 7:41 pm on February 1, 2018:
    Do we really want to remove the return argument here? I think it’s useful for it to be able to signal failure, for example to log an error, even if we don’t use that at the moment.

    theuni commented at 7:57 pm on February 1, 2018:

    Yes, this is actually a really big help for the libevent code. This needs to be a one-way function so that it can be run async, with failures optionally triggering callbacks.

    The oneshot reinsertion was the only thing preventing making that change trivially.

    Edit: See here for that change on the libevent PR: https://github.com/bitcoin/bitcoin/pull/11227/commits/03e73a734ceac8a2fc7ed1a21a752e3580b47569. Notice the only thing the failed-connect callback does: https://github.com/bitcoin/bitcoin/commit/03e73a734ceac8a2fc7ed1a21a752e3580b47569#diff-9a82240fe7dfe86564178691cc57f2f1R2013


    laanwj commented at 8:20 pm on February 1, 2018:
    ok, makes sense then
  6. laanwj added the label Needs backport on Feb 1, 2018
  7. jonasschnelli commented at 8:52 pm on February 1, 2018: contributor
    utACK 660f5f19ae74cc81b83540fcb95a33ec437834c8
  8. theuni commented at 8:57 pm on February 1, 2018: member

    @sipa mentioned on IRC that these were originally retried because they may be tor seed attempts, which can only try one address, as opposed to normal seed resolves which may return a long list.

    So by not retrying these, if using tor, you only get seednode_count chances to make a connection and learn some new addresses.

    To avoid that, I think we should just re-run the entire ThreadDNSAddressSeed() as necessary until we have the desired connections.

  9. achow101 commented at 10:11 pm on February 1, 2018: member
    utACK 660f5f19ae74cc81b83540fcb95a33ec437834c8
  10. meshcollider commented at 0:23 am on February 2, 2018: contributor

    @theuni To avoid that, I think we should just re-run the entire ThreadDNSAddressSeed() as necessary until we have the desired connections.

    Are you going to do that in this PR or leave it for later?

    utACK https://github.com/bitcoin/bitcoin/pull/12329/commits/660f5f19ae74cc81b83540fcb95a33ec437834c8

  11. laanwj commented at 8:49 am on February 2, 2018: member

    Are you going to do that in this PR or leave it for later?

    Let’s leave that for a future PR, and take this fix for rc2.

  12. laanwj referenced this in commit 5303970c26 on Feb 2, 2018
  13. laanwj merged this on Feb 2, 2018
  14. laanwj closed this on Feb 2, 2018

  15. laanwj referenced this in commit aa360e76a7 on Feb 2, 2018
  16. laanwj removed the label Needs backport on Feb 8, 2018
  17. HashUnlimited referenced this in commit dd09603c5f on Mar 16, 2018
  18. lyricidal referenced this in commit d76df0729a on Nov 17, 2019
  19. PastaPastaPasta referenced this in commit 7ebd9698eb on Jan 26, 2020
  20. PastaPastaPasta referenced this in commit 815672467f on Jan 26, 2020
  21. PastaPastaPasta referenced this in commit 88cb85752c on Jan 26, 2020
  22. PastaPastaPasta referenced this in commit 539d71e671 on Jan 27, 2020
  23. PastaPastaPasta referenced this in commit 03576217e5 on Jan 27, 2020
  24. ckti referenced this in commit a6968bb6e5 on Mar 28, 2021
  25. gades referenced this in commit 9e36050932 on Jun 25, 2021
  26. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me