From 91de68fd4b9f008b97494660caea3e33ecf9cf01 Mon Sep 17 00:00:00 2001 From: Gabi Date: Thu, 14 Mar 2024 02:49:28 -0300 Subject: [PATCH] fix(apple): spawn new thread for runtime to prevent it from being taken down (#4141) Using the current thread in apple was causing a crashloop, since connlib's thread was taken down by the network extension after `WrappedSession::connect` returned. Now we force the runtime to create the thread to prevent it from being taken down. --- rust/connlib/clients/apple/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/connlib/clients/apple/src/lib.rs b/rust/connlib/clients/apple/src/lib.rs index dfa31675f..a8285a6da 100644 --- a/rust/connlib/clients/apple/src/lib.rs +++ b/rust/connlib/clients/apple/src/lib.rs @@ -209,7 +209,9 @@ impl WrappedSession { ) .map_err(|e| e.to_string())?; - let runtime = tokio::runtime::Builder::new_current_thread() + let runtime = tokio::runtime::Builder::new_multi_thread() + .worker_threads(1) + .thread_name("connlib") .enable_all() .build() .map_err(|e| e.to_string())?;