Limit Rayon threadpool threads (#5871)

This commit is contained in:
Sagar Dhawan
2019-09-12 11:39:39 -07:00
committed by GitHub
parent 385086359c
commit c1d788880d
16 changed files with 73 additions and 30 deletions

View File

@@ -22,6 +22,7 @@ solana-storage-program = { path = "../programs/storage_program", version = "0.19
solana-vote-api = { path = "../programs/vote_api", version = "0.19.0-pre0" }
symlink = "0.1.0"
tempfile = "3.1.0"
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "0.19.0-pre0" }
[dev-dependencies]
serial_test = "0.2.0"

View File

@@ -10,6 +10,7 @@ use solana_core::{
service::Service,
validator::{Validator, ValidatorConfig},
};
use solana_rayon_threadlimit::set_thread_count;
use solana_sdk::{
client::SyncClient,
clock::DEFAULT_TICKS_PER_SLOT,
@@ -116,6 +117,8 @@ impl LocalCluster {
}
pub fn new(config: &ClusterConfig) -> Self {
set_thread_count(1);
assert_eq!(config.validator_configs.len(), config.node_stakes.len());
let leader_keypair = Arc::new(Keypair::new());
let leader_pubkey = leader_keypair.pubkey();

View File

@@ -27,8 +27,6 @@ use tempfile::TempDir;
#[test]
#[serial]
#[allow(unused_attributes)]
#[ignore]
fn test_ledger_cleanup_service() {
solana_logger::setup();
error!("test_ledger_cleanup_service");
@@ -111,9 +109,8 @@ fn test_spend_and_verify_all_nodes_3() {
);
}
#[allow(unused_attributes)]
#[test]
#[serial]
#[allow(unused_attributes)]
#[ignore]
fn test_spend_and_verify_all_nodes_env_num_nodes() {
solana_logger::setup();
@@ -132,7 +129,6 @@ fn test_spend_and_verify_all_nodes_env_num_nodes() {
#[allow(unused_attributes)]
#[test]
#[serial]
#[should_panic]
fn test_fullnode_exit_default_config_should_panic() {
solana_logger::setup();
@@ -161,10 +157,8 @@ fn test_fullnode_exit_2() {
}
// Cluster needs a supermajority to remain, so the minimum size for this test is 4
#[allow(unused_attributes)]
#[test]
#[serial]
#[ignore]
fn test_leader_failure_4() {
solana_logger::setup();
error!("test_leader_failure_4");
@@ -222,14 +216,14 @@ fn test_two_unbalanced_stakes() {
}
#[test]
#[ignore]
#[serial]
fn test_forwarding() {
// Set up a cluster where one node is never the leader, so all txs sent to this node
// will be have to be forwarded in order to be confirmed
let config = ClusterConfig {
node_stakes: vec![999_990, 3],
cluster_lamports: 2_000_000,
validator_configs: vec![ValidatorConfig::default(); 3],
validator_configs: vec![ValidatorConfig::default(); 2],
..ClusterConfig::default()
};
let cluster = LocalCluster::new(&config);
@@ -363,7 +357,6 @@ fn test_snapshot_restart_locktower() {
);
}
#[allow(unused_attributes)]
#[test]
#[serial]
fn test_snapshots_blocktree_floor() {
@@ -524,15 +517,14 @@ fn test_snapshots_restart_validity() {
}
}
#[allow(unused_attributes)]
#[test]
#[serial]
#[ignore]
fn test_fail_entry_verification_leader() {
test_faulty_node(BroadcastStageType::FailEntryVerification);
}
#[test]
#[allow(unused_attributes)]
#[ignore]
fn test_fake_blobs_broadcast_leader() {
test_faulty_node(BroadcastStageType::BroadcastFakeBlobs);
@@ -591,9 +583,7 @@ fn test_faulty_node(faulty_node_type: BroadcastStageType) {
);
}
#[allow(unused_attributes)]
#[test]
#[serial]
#[ignore]
fn test_repairman_catchup() {
solana_logger::setup();