Skip to content

Commit

Permalink
Merge bitcoin#20024: init: Fix incorrect warning "Reducing -maxconnec…
Browse files Browse the repository at this point in the history
…tions from N to N-1, because of system limitations"

ea93bbe init: Fix incorrect warning "Reducing -maxconnections from N to N-1, because of system limitations" (practicalswift)

Pull request description:

  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]
  ```

ACKs for top commit:
  n-thumann:
    tACK bitcoin@ea93bbe, 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 ✌️
  laanwj:
    Code review ACK ea93bbe
  theStack:
    tACK ea93bbe

Tree-SHA512: 9b0939a1a51fdf991d11024a5d20b4f39cab1a80320b799a1d24d0250aa059666bcb1ae6dd79c941c2f2686f07f59fc0f6618b5746aa8ca6011fdd202828a930
  • Loading branch information
laanwj authored and PastaPastaPasta committed Jul 16, 2021
1 parent 8bf157e commit 7cfcb9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ bool AppInitParameterInteraction()

// Trim requested connection counts, to fit into system limitations
// <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS);
nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS + nBind);
#ifdef USE_POLL
int fd_max = nFD;
#else
Expand Down

0 comments on commit 7cfcb9a

Please sign in to comment.