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.
This commit is contained in:
Gabi
2024-03-14 02:49:28 -03:00
committed by GitHub
parent 05e5ca609c
commit 91de68fd4b

View File

@@ -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())?;