Closed
Description
For hosting my web projects I am using Linux on 3-rd party cloud provider
On that system installed 104 CPUs and also set maximum number of processes for user = 40 ( by ulimit -u
)
Current std::thread::available_parallelism implementation always return 104 (instead 40), 3-rd party crates (for example rayon) try to creates thread pool for max , but host system restricts such attempts and rust throw to exception
Due to this exception I can't even install Rust (with using rustup) in my home at this system
Traceback for rustup
thread 'main' panicked at .../rayon-core-1.12.1/src/registry.rs:168:10:
The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
stack backtrace:
0: 0x55919894eb6c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h388b5563225da53c
1: 0x5591985ea79b - core::fmt::write::h7f11a232f16bffb4
2: 0x559198911752 - std::io::Write::write_fmt::h6c69f7c334e53b10
3: 0x559198951d48 - std::panicking::default_hook::{{closure}}::h33d794e7524ee3df
4: 0x5591989519d1 - std::panicking::default_hook::h761c6a87e7786414
5: 0x5591989529e9 - std::panicking::rust_panic_with_hook::h76eaaf856d4627ce
6: 0x559198952755 - std::panicking::begin_panic_handler::{{closure}}::h822501910e3f1a1e
7: 0x5591989526b9 - std::sys::backtrace::__rust_end_short_backtrace::hd0a94a8e1050aebb
8: 0x5591989526a4 - rust_begin_unwind
9: 0x5591985e9502 - core::panicking::panic_fmt::h20afa97c0700e760
10: 0x5591985ee7b5 - core::result::unwrap_failed::hb85382bc192f0b4e
11: 0x55919865e65b - rayon_core::registry::global_registry::hd507095517146e2d
12: 0x55919886c04e - remove_dir_all::_impl::remove_dir_contents_recursive::h95c8f79df37c7add
13: 0x559198810951 - remove_dir_all::_impl::remove_dir_all_path::h1cbfde4847891883
14: 0x55919882f6ed - core::ptr::drop_in_place<rustup::dist::temp::Dir>::h6d8f29d59fbbbade
15: 0x55919886619f - rustup::dist::component::package::TarPackage::new::hd25c5afdf0eea170
16: 0x55919885c838 - rustup::dist::component::package::TarXzPackage::new::hc48a3c02f0beadd1
17: 0x55919881a42f - rustup::dist::manifestation::Manifestation::update::h7b45faa9d05e9945
18: 0x559198811f0c - rustup::dist::dist::try_update_from_dist_::h8c05956ab5371c1c
19: 0x55919880f583 - rustup::install::InstallMethod::install::h09f0bf01539cc897
20: 0x55919880c645 - rustup::toolchain::distributable::DistributableToolchain::install::hfc214fca9f3953f6
21: 0x559198908489 - rustup::cli::self_update::install::h81aa5f4060099435
22: 0x5591989005d2 - rustup::cli::setup_mode::main::h8ad5c7f7a0d657f3
23: 0x55919854b221 - rustup_init::main::h5a60573c3e8e09fa
24: 0x5591985479f3 - std::sys::backtrace::__rust_begin_short_backtrace::h80d522419e5738bf
25: 0x55919854bc74 - main
26: 0x7f947a429d90 - <unknown>
27: 0x7f947a429e40 - __libc_start_main
28: 0x559198547925 - _start
29: 0x0 - <unknown>
thread 'main' panicked at core/src/panicking.rs:229:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.