init: Improve file descriptor limit handling #27730

pull fjahr wants to merge 1 commits into bitcoin:master from fjahr:2023-05-fd-limit changing 1 files +17 −6
  1. fjahr commented at 8:44 pm on May 23, 2023: contributor

    I was playing with file descriptor limits to test another issue saw the following warning printed when I had configured a file descriptor limit of 150:

    0Warning: Reducing -maxconnections from 125 to -9, because of system limitations.
    

    The warning could have been resolved with a one-line change but I found the surrounding code hard to reason about at first, so I added a few comments and reorganized the code a bit for better clarity.

    Aside from the warning there is one further behavior change: If the limitation of file descriptors prevents the node from making any connections the node doesn’t start unless the user has explicitly set -maxconnections to 0. This is not just about the node not being able to make connections: When I started the node right at the limit I wasn’t able to shut it down cleanly any more several times and instead had to kill the process manually. So this shouldn’t be anything normal users should be able to run into.

  2. init: Improve file descriptor limit handling 88454971fc
  3. DrahtBot commented at 8:45 pm on May 23, 2023: contributor

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

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #27539 (init: Fixes for file descriptor accounting by Empact)

    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. fanquake commented at 4:53 am on May 24, 2023: member
    Duplicate of #27539?
  5. fjahr commented at 8:09 am on May 24, 2023: contributor

    Duplicate of #27539?

    Ugh, mostly yeah.

  6. fjahr closed this on May 24, 2023

  7. bitcoin locked this on May 23, 2024

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 15:12 UTC

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