You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2025/07/05 11:18:41 UTC

(iggy) branch io_uring_tpc updated: fix(io_uring): skip thread_pool_limit(0) on macOS (#1963)

This is an automated email from the ASF dual-hosted git repository.

hgruszecki pushed a commit to branch io_uring_tpc
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/io_uring_tpc by this push:
     new 70071d8d fix(io_uring): skip thread_pool_limit(0) on macOS (#1963)
70071d8d is described below

commit 70071d8dce452edf3caeb4c6b98b5f2b11d8b8b5
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Sat Jul 5 13:18:37 2025 +0200

    fix(io_uring): skip thread_pool_limit(0) on macOS (#1963)
---
 core/server/src/bootstrap.rs | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/core/server/src/bootstrap.rs b/core/server/src/bootstrap.rs
index 6a2eb8af..ead6242a 100644
--- a/core/server/src/bootstrap.rs
+++ b/core/server/src/bootstrap.rs
@@ -122,21 +122,28 @@ pub fn create_root_user() -> User {
 }
 
 pub fn create_shard_executor() -> Runtime {
-    //TODO: The event intererval tick, could be configureed based on the fact
+    // TODO: The event intererval tick, could be configured based on the fact
     // How many clients we expect to have connected.
     // This roughly estimates the number of tasks we will create.
-    let proactor = compio::driver::ProactorBuilder::new()
+
+    let mut proactor = compio::driver::ProactorBuilder::new();
+
+    proactor
         .capacity(4096)
         .coop_taskrun(true)
-        .taskrun_flag(false) //TODO: Try enabling this.
-        .thread_pool_limit(0)
-        .to_owned();
-    let rt = compio::runtime::RuntimeBuilder::new()
-        .with_proactor(proactor)
+        .taskrun_flag(false); // TODO: Try enabling this.
+
+    // FIXME(hubcio): Only set thread_pool_limit(0) on non-macOS platforms
+    // This causes a freeze on macOS with compio fs operations
+    // see https://github.com/compio-rs/compio/issues/446
+    #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))]
+    proactor.thread_pool_limit(0);
+
+    compio::runtime::RuntimeBuilder::new()
+        .with_proactor(proactor.to_owned())
         .event_interval(69)
         .build()
-        .unwrap();
-    rt
+        .unwrap()
 }
 
 pub fn resolve_persister(enforce_fsync: bool) -> Arc<PersisterKind> {