Skip to content

Commit

Permalink
fix: handle if num_cpus / 2 == 0 (#2740)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia authored Nov 14, 2023
1 parent dc46e96 commit e2a770f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mito2/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl MitoConfig {
// Sanitize worker num.
let num_workers_before = self.num_workers;
if self.num_workers == 0 {
self.num_workers = num_cpus::get() / 2;
self.num_workers = (num_cpus::get() / 2).max(1);
}
if num_workers_before != self.num_workers {
warn!(
Expand Down

0 comments on commit e2a770f

Please sign in to comment.