From 15753f48fc027a8193d45094e9e0f272f05efa94 Mon Sep 17 00:00:00 2001 From: Bo Yao Date: Tue, 4 Feb 2020 15:51:55 -0800 Subject: [PATCH] Move sysinfo fix from staging (#2085) * Move sysinfo fix from staging --- Cargo.lock | 7 ++++--- chain/client/Cargo.toml | 2 +- chain/client/src/info.rs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaac84f87b4..3f1c0d1f7a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2023,7 +2023,7 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "sysinfo 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sysinfo 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3338,13 +3338,14 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "ntapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4317,7 +4318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" "checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -"checksum sysinfo 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "02067c0c215cbc50176ad0c8718183c5e6bfd3d97c6913c26abeae3bfa8ed2ae" +"checksum sysinfo 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8834e42be61ae4f6338b216fbb69837c7f33c3d4d3a139fb073735b25af4d9e" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" diff --git a/chain/client/Cargo.toml b/chain/client/Cargo.toml index b1fc72469cf..1ac4f0e76da 100644 --- a/chain/client/Cargo.toml +++ b/chain/client/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.7" serde = { version = "1.0", features = ["derive"] } serde_derive = "1.0" serde_json = "1.0" -sysinfo = "0.10" +sysinfo = "0.10.5" cached = "0.11.0" lazy_static = "1.4" borsh = "0.2.10" diff --git a/chain/client/src/info.rs b/chain/client/src/info.rs index 1c79cc50874..c7a0f017a0f 100644 --- a/chain/client/src/info.rs +++ b/chain/client/src/info.rs @@ -4,7 +4,7 @@ use actix::Addr; use ansi_term::Color::{Blue, Cyan, Green, White, Yellow}; use log::info; use serde_json::json; -use sysinfo::{get_current_pid, Pid, ProcessExt, System, SystemExt}; +use sysinfo::{get_current_pid, set_open_files_limit, Pid, ProcessExt, System, SystemExt}; use near_chain::Tip; use near_network::types::{NetworkInfo, PeerId}; @@ -40,6 +40,7 @@ impl InfoHelper { telemetry_actor: Addr, block_producer: Option, ) -> Self { + set_open_files_limit(0); InfoHelper { started: Instant::now(), num_blocks_processed: 0,