fix(introspection): add conditional arbiter creation for io-uring support

This commit is contained in:
Guillermo Céspedes Tabárez 2025-03-04 05:30:49 -03:00
parent a79dc9dc79
commit 3b99f86e89
1 changed files with 12 additions and 1 deletions

View File

@ -380,14 +380,25 @@ mod tests {
// Spawn tasks on the arbiter. Each task runs the full introspection flow and then signals completion. // Spawn tasks on the arbiter. Each task runs the full introspection flow and then signals completion.
for _ in 0..NUM_TASKS { for _ in 0..NUM_TASKS {
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
// Create an Arbiter with a dedicated Tokio runtime.
#[cfg(all(target_os = "linux", feature = "experimental-io-uring"))]
let arbiter = {
// TODO: pass max blocking thread config when tokio-uring enable configuration
// on building runtime.
let _ = config.max_blocking_threads;
actix_rt::Arbiter::new()
};
#[cfg(not(all(target_os = "linux", feature = "experimental-io-uring")))]
let arbiter = actix_rt::Arbiter::with_tokio_rt(move || { let arbiter = actix_rt::Arbiter::with_tokio_rt(move || {
// Create an Arbiter with a dedicated Tokio runtime.
tokio::runtime::Builder::new_current_thread() tokio::runtime::Builder::new_current_thread()
.enable_all() .enable_all()
.max_blocking_threads(max_blocking_threads) .max_blocking_threads(max_blocking_threads)
.build() .build()
.unwrap() .unwrap()
}); });
// Spawn the task on the arbiter. // Spawn the task on the arbiter.
arbiter.spawn(async move { arbiter.spawn(async move {
run_full_introspection_flow(); run_full_introspection_flow();