From d0b687b31284601e4ee82d716527d7acc5226bae Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 14 Aug 2023 11:23:48 +0200 Subject: [PATCH] fix: spawn js service task on blocking pool (#4180) --- crates/rpc/rpc/src/debug.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index cf7a98b745..c3cba02e3e 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -538,7 +538,9 @@ where let (to_db_service, rx) = mpsc::channel(1); let (ready_tx, ready_rx) = std::sync::mpsc::channel(); let this = self.clone(); - self.inner.task_spawner.spawn(Box::pin(async move { + // this needs to be on a blocking task because it only does blocking work besides waiting + // for db requests + self.inner.task_spawner.spawn_blocking(Box::pin(async move { this.js_trace_db_service_task(at, rx, ready_tx, db).await })); // wait for initialization