Skip to content

Commit

Permalink
fix s3 stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Oct 25, 2023
1 parent 21e9740 commit fcd6992
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/expr/src/expr/expr_udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ impl<'a> TryFrom<&'a ExprNode> for UdfExpression {
},
Some(PbExtra::Wasm(PbWasmUdfExtra { wasm_storage_url })) => {
let wasm_engine = WasmEngine::get_or_create();
let component = futures::executor::block_on({
wasm_engine
.load_component(wasm_storage_url, &udf.identifier)
.instrument(tracing::info_span!("load_component", %udf.identifier))
// Use `block_in_place` as an escape hatch to run async code here in sync context.
// Calling `block_on` directly will panic.
let component = tokio::task::block_in_place(|| {
tokio::runtime::Handle::current().block_on({
wasm_engine
.load_component(wasm_storage_url, &udf.identifier)
.instrument(tracing::info_span!("load_component", %udf.identifier))
})
})?;

UdfImpl::Wasm { component }
Expand Down

0 comments on commit fcd6992

Please sign in to comment.