Skip to content

Improve minimum file descriptor accounting and documentation #18911

@fanquake

Description

@fanquake

#16003 has been closed, and I've pulled out the unrelated p2p change. However I think it's worth someone following up and taking a look at our startup file descriptor accounting.

As mentioned in #16003, if bitcoind is started somewhere that the maximum number of open file descriptors is limited, we can run into some nonsensical behaviour. Such as a "negative" number of maximum connections:

# using bash
ulimit -n 150
src/bitcoind
[init] Using at most -8 automatic connections (150 file descriptors available)

It's also impossible to shutdown bitcoind from this state as the opencon thread will never exit.

It would be good for someone to look through this code, document assumptions, and fix issues like the above.

You do not need to request permission to start working on this. You are encouraged to comment on the issue if you are planning to work on it. This will help other contributors monitor which issues are actively being addressed and is also an effective way to request assistance if and when you need it.

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions