init: Fix incorrect warning "Reducing -maxconnections from N to N-1, because of system limitations" #20024

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fix-incorrect-warning changing 1 files +1 −1
  1. practicalswift commented at 3:03 PM on September 26, 2020: contributor

    Fix incorrect warning Reducing -maxconnections from N to N-1, because of system limitations.

    Before this patch (only the first warning is correct):

    $ src/bitcoind -maxconnections=10000000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 10000000 to 1048417, because of system limitations.
    
    $ src/bitcoind -maxconnections=1000000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 1000000 to 999999, because of system limitations.
    
    $ src/bitcoind -maxconnections=100000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 100000 to 99999, because of system limitations.
    
    $ src/bitcoind -maxconnections=10000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 10000 to 9999, because of system limitations.
    
    $ src/bitcoind -maxconnections=1000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 1000 to 999, because of system limitations.
    
    $ src/bitcoind -maxconnections=100 | grep Warning
    [no warning]
    

    After this patch (no incorrect warnings):

    $ src/bitcoind -maxconnections=10000000 | grep Warning
    2020-09-26T01:23:45Z Warning: Reducing -maxconnections from 10000000 to 1048417, because of system limitations.
    
    $ src/bitcoind -maxconnections=1000000 | grep Warning
    [no warning]
    
    $ src/bitcoind -maxconnections=100000 | grep Warning
    [no warning]
    
    $ src/bitcoind -maxconnections=10000 | grep Warning
    [no warning]
    
    $ src/bitcoind -maxconnections=1000 | grep Warning
    [no warning]
    
    $ src/bitcoind -maxconnections=100 | grep Warning
    [no warning]
    
  2. init: Fix incorrect warning "Reducing -maxconnections from N to N-1, because of system limitations" ea93bbeb26
  3. DrahtBot commented at 9:09 PM on September 26, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19509 (Per-Peer Message Capture by troygiorshev)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. n-thumann commented at 10:07 PM on September 27, 2020: contributor

    Just ran your change on macOS and Debian and wasn´t able to reproduce the error or saw any difference with and without your change applied, so this error may only be affecting some systems 🤔 macOS 10.15.6 at ea93bbeb2 & 23d3ae7ac

    $ ./src/bitcoind --maxconnections=10000000 | grep Warning
    Warning: Reducing -maxconnections from 10000000 to 865, because of system limitations.
    2020-09-27T21:41:03Z Warning: Reducing -maxconnections from 10000000 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=1000000 | grep Warning 
    Warning: Reducing -maxconnections from 1000000 to 865, because of system limitations.
    2020-09-27T21:41:17Z Warning: Reducing -maxconnections from 1000000 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=100000 | grep Warning 
    Warning: Reducing -maxconnections from 100000 to 865, because of system limitations.
    2020-09-27T21:41:23Z Warning: Reducing -maxconnections from 100000 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=10000 | grep Warning 
    Warning: Reducing -maxconnections from 10000 to 865, because of system limitations.
    2020-09-27T21:41:29Z Warning: Reducing -maxconnections from 10000 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=1000 | grep Warning 
    Warning: Reducing -maxconnections from 1000 to 865, because of system limitations.
    2020-09-27T21:41:35Z Warning: Reducing -maxconnections from 1000 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=866 | grep Warning 
    Warning: Reducing -maxconnections from 866 to 865, because of system limitations.
    2020-09-27T21:41:44Z Warning: Reducing -maxconnections from 866 to 865, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=865 | grep Warning
    [no warning]
    

    Debian Buster (10.5, 4.19.76-linuxkit) in Docker on macOS at ea93bbeb2 & 23d3ae7ac

    $ ./src/bitcoind --maxconnections=10000000 | grep Warning
    Warning: Reducing -maxconnections from 10000000 to 1048417, because of system limitations.
    2020-09-27T21:52:54Z Warning: Reducing -maxconnections from 10000000 to 1048417, because of system limitations.
    
    $ ./src/bitcoind --maxconnections=1000000 | grep Warning
    [no warning]
    $ ./src/bitcoind --maxconnections=100000 | grep Warning
    [no warning]
    
  5. fanquake commented at 7:19 AM on September 29, 2020: member

    Related to #18911.

  6. practicalswift commented at 2:38 PM on September 29, 2020: contributor

    @n-thumann Thanks for testing! Good to know that you're not affected. FWIW I've seen this on multiple machines :)

    Hopefully others will chime in to add their observations: that might allow us to pinpoint exactly which systems that are affected.

  7. n-thumann commented at 3:57 PM on September 29, 2020: contributor

    tACK https://github.com/bitcoin/bitcoin/pull/20024/commits/ea93bbeb26948c0ddba39b589bd166eaecf446c8, Ran on other systems running Debian 10.5 (4.19.0-8-amd64) and Debian bullseye/sid (5.3.0-1-amd64) and was able to reproduce the issue exactly as you described above on both of them. After applying your patch the issue is fixed :v:

  8. theStack approved
  9. theStack commented at 5:04 PM on October 11, 2020: member

    tACK ea93bbeb26948c0ddba39b589bd166eaecf446c8 I can confirm the behaviour in the PR description (for both in master branch and PR branch where it's fixed) with the same warning output numbers, running Ubuntu 16.04.6 LTS in x86_64 with Kernel 4.4.0 here.

  10. laanwj commented at 2:32 PM on November 19, 2020: member

    Code review ACK ea93bbeb26948c0ddba39b589bd166eaecf446c8

  11. laanwj merged this on Nov 19, 2020
  12. laanwj closed this on Nov 19, 2020

  13. sidhujag referenced this in commit 6447f28930 on Nov 19, 2020
  14. practicalswift deleted the branch on Apr 10, 2021
  15. PastaPastaPasta referenced this in commit 3af1b66f5c on Jun 27, 2021
  16. PastaPastaPasta referenced this in commit e57cb6f5e0 on Jun 28, 2021
  17. PastaPastaPasta referenced this in commit 5468ec4fbf on Jun 29, 2021
  18. PastaPastaPasta referenced this in commit fde021ba52 on Jul 1, 2021
  19. PastaPastaPasta referenced this in commit 2d900a58b2 on Jul 1, 2021
  20. PastaPastaPasta referenced this in commit 33d3138aed on Jul 15, 2021
  21. PastaPastaPasta referenced this in commit f1bd5a2f37 on Jul 15, 2021
  22. PastaPastaPasta referenced this in commit 7cfcb9a74c on Jul 16, 2021
  23. gabriel-bjg referenced this in commit 088d84c0ae on Jul 16, 2021
  24. DrahtBot locked this on Aug 18, 2022

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: 2026-04-16 15:14 UTC

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