tokio-rs / io-uring

The `io_uring` library for Rust
Apache License 2.0
1.22k stars 134 forks source link

RLIMIT_NOFILE #143

Open FrankReh opened 2 years ago

FrankReh commented 2 years ago

In Sep of 2021, with two commits, the liburing project added support to automatically try to increase the soft RLIMIT_NOFILE when its API functions hit the EMFILE error - there were two such API functions at the time. Since then, additional API functions have been added and each has also performed the same check against EMFILE and tried one time to increase the limit before having to return EMFILE to the caller.

Should this crate assume the same role in trying to increase the soft limit when EMFILE is encountered?

FrankReh commented 2 years ago

I would like to soon provide a PR for the multishot accept operation and it would be nice to support the multishot accept direct operation as well, and so having a large sparse direct fd table setup could be quite common and hitting the soft RLIMIT_NOFILE seems more likely.

Noah-Kennedy commented 2 years ago

@FrankReh I'd say we should, conditional on a builder flag. I think we could let that flag be default though.

FrankReh commented 1 year ago

@quininer What's your read on this? Would a PR that did this with a builder flag be acceptable?