Skip to content

Commit f60b782

Browse files
Ensure execution concurrency level is at least 1 (#17744)
* Ensure execution concurrency level is at least 1 * lint * lint * lint
1 parent 24c1dd5 commit f60b782

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

aptos-node/src/utils.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use aptos_types::{
1313
};
1414
use aptos_vm::AptosVM;
1515
use aptos_vm_environment::prod_configs::set_paranoid_type_checks;
16-
use std::cmp::min;
1716

1817
/// Error message to display when non-production features are enabled
1918
pub const ERROR_MSG_BAD_FEATURE_FLAGS: &str = r#"
@@ -52,10 +51,7 @@ pub fn fetch_chain_id(db: &DbReaderWriter) -> anyhow::Result<ChainId> {
5251
pub fn set_aptos_vm_configurations(node_config: &NodeConfig) {
5352
set_paranoid_type_checks(node_config.execution.paranoid_type_verification);
5453
let effective_concurrency_level = if node_config.execution.concurrency_level == 0 {
55-
min(
56-
DEFAULT_EXECUTION_CONCURRENCY_LEVEL,
57-
(num_cpus::get() / 2) as u16,
58-
)
54+
((num_cpus::get() / 2) as u16).clamp(1, DEFAULT_EXECUTION_CONCURRENCY_LEVEL)
5955
} else {
6056
node_config.execution.concurrency_level
6157
};

0 commit comments

Comments
 (0)