Skip to content

Commit

Permalink
fix(apple): spawn new thread for runtime to prevent it from being tak…
Browse files Browse the repository at this point in the history
…en 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.
  • Loading branch information
conectado committed Mar 14, 2024
1 parent 05e5ca6 commit 91de68f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rust/connlib/clients/apple/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?;
Expand Down

0 comments on commit 91de68f

Please sign in to comment.