Giter Site home page Giter Site logo

Comments (2)

huonw avatar huonw commented on September 22, 2024

Ah, yes, this would be annoying.

It sounds like you might've found where this is defined:

pub fn increase_limits() -> Result<String, String> {
loop {
let (cur, max) = rlimit::Resource::NOFILE
.get()
.map_err(|e| format!("Could not validate file handle limits: {e}"))?;
// If the limit is less than our target.
if cur < TARGET_NOFILE_LIMIT {
let err_suffix = format!(
"To avoid 'too many open file handle' errors, we recommend a limit of at least {TARGET_NOFILE_LIMIT}: \
please see https://www.pantsbuild.org/docs/troubleshooting#too-many-open-files-error \
for more information."
);
// If we might be able to increase the soft limit, try to.
if cur < max {
let target_soft_limit = std::cmp::min(max, TARGET_NOFILE_LIMIT);
rlimit::Resource::NOFILE
.set(target_soft_limit, max)
.map_err(|e| {
format!("Could not raise soft file handle limit above {cur}: `{e}`. {err_suffix}")
})?;
} else {
return Err(format!(
"File handle limit is capped to: {cur}. {err_suffix}"
));
}
} else {
return Ok(format!("File handle limit is: {cur}"));
};
}
}

That's called from

match fs::increase_limits() {

Which is called from

self._py_scheduler = native_engine.scheduler_create(

Three options to address this might be:

  1. use [GLOBAL].ignore_warnings: https://www.pantsbuild.org/2.20/reference/global-options#ignore_warnings to silence this (although I'm not 100% sure this'll work...)
  2. convert TARGET_NOFILE_LIMIT into a global option (with default 10000) that's passed down, so it can be customised when the env has a lower limit, e.g. target_file_handle_limit = 8192
  3. add a boolean option to silence this warning specific, e.g. allow_file_handle_limit_below_target = true or something.

I'm not sure what's best. Can you make 1 work?

from pants.

Taytay avatar Taytay commented on September 22, 2024

Ah cool - I can give one of these a shot and see if they work. Thanks!

from pants.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.