From a22e2a67bcec1e13ee50457bd3b5800cff756a5d Mon Sep 17 00:00:00 2001 From: Stephen Carman Date: Fri, 13 Sep 2024 12:45:34 -0400 Subject: [PATCH 1/2] bug: conditionally disable enable_io non-unix based systems --- crates/core/src/storage/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/core/src/storage/mod.rs b/crates/core/src/storage/mod.rs index 37daab755f..5cca2b30ab 100644 --- a/crates/core/src/storage/mod.rs +++ b/crates/core/src/storage/mod.rs @@ -52,13 +52,17 @@ fn io_rt(config: Option<&RuntimeConfig>) -> &Runtime { let builder = builder.worker_threads(config.worker_threads); let builder = if config.enable_io && config.enable_time { builder.enable_all() - } else if config.enable_io && !config.enable_time { - builder.enable_io() } else if !config.enable_io && config.enable_time { builder.enable_time() } else { builder }; + #[cfg(unix)] + { + if config.enable_io && !config.enable_time { + builder = builder.enable_io(); + } + } builder .thread_name( config From 73107a758df57aeaf718eb85f7e81bd0b5786ff7 Mon Sep 17 00:00:00 2001 From: Stephen Carman Date: Fri, 13 Sep 2024 12:51:45 -0400 Subject: [PATCH 2/2] bug: conditionally disable enable_io non-unix based systems --- crates/core/src/storage/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core/src/storage/mod.rs b/crates/core/src/storage/mod.rs index 5cca2b30ab..f712db435d 100644 --- a/crates/core/src/storage/mod.rs +++ b/crates/core/src/storage/mod.rs @@ -49,8 +49,8 @@ fn io_rt(config: Option<&RuntimeConfig>) -> &Runtime { } else { RuntimeBuilder::new_current_thread() }; - let builder = builder.worker_threads(config.worker_threads); - let builder = if config.enable_io && config.enable_time { + let mut builder = builder.worker_threads(config.worker_threads); + let mut builder = if config.enable_io && config.enable_time { builder.enable_all() } else if !config.enable_io && config.enable_time { builder.enable_time()