We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d1a91c commit 7bd848aCopy full SHA for 7bd848a
1 file changed
crates/core/src/host/module_host.rs
@@ -592,11 +592,13 @@ impl ModuleHost {
592
// compiler that `dyn ModuleInstance` is unwind safe.
593
// If a reducer call panics, we **must** ensure to call `self.on_panic`
594
// so that the module is discarded by the host controller.
595
- let result = tokio::spawn(async move { f(&mut *inst) }).await.unwrap_or_else(|e| {
596
- log::warn!("reducer {reducer} panicked");
597
- (self.on_panic)();
598
- std::panic::resume_unwind(e.into_panic());
599
- });
+ let result = tokio::task::spawn_blocking(move || f(&mut *inst))
+ .await
+ .unwrap_or_else(|e| {
+ log::warn!("reducer {reducer} panicked");
+ (self.on_panic)();
600
+ std::panic::resume_unwind(e.into_panic());
601
+ });
602
Ok(result)
603
}
604
0 commit comments