Component `Func::call` (sync call) can fail due to a lack of event loop
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading the Func::call and Func::call_async implementations and the component runtime event loop and fiber handling. Reproduce the supplied component example and inspect how its async function is called through the synchronous entry point. The issue leaves the design unresolved; done would require an agreed approach, such as deprecating Func::call, and tests covering the behavior.
由索引模型根据 Issue 内容生成。
描述
This program:
use wasmtime::component::{Component, Linker};
use wasmtime::{Engine, Store};
fn main() {
let engine = Engine::default();
let component = Component::new(
&engine,
r#"
(component
(component $inner
(core module $m
(func (export "f") (param i32) (result i32)
(i32.add (local.get 0) (i32.const 3))))
(core instance $i (instantiate $m))
(func (export "f") async (param "x" u32) (result u32)
(canon lift (core func $i "f"))))
(instance $inner (instantiate $inner))
(core func $f (canon lower (func $inner "f")))
(core module $m
(import "" "f" (func $f (param i32) (result i32)))
(func (export "run") (param i32) (result i32) (call $f (local.get 0))))
(core instance $i (instantiate $m (with "" (instance (export "f" (func $f))))))
(func (export "run") (param "x" u32) (result u32)
(canon lift (core func $i "run")))
)
"#,
)
.unwrap();
let mut store = Store::new(&engine, ());
let instance = Linker::new(&engine).instantiate(&mut store, &component).unwrap();
let run = instance
.get_typed_func::<(u32,), (u32,)>(&mut store, "run")
.unwrap();
println!("{:?}", run.call(&mut store, (4,)));
}
currently yields:
$ cargo run
thread 'main' panicked at .../wasmtime-50.0.0/src/runtime/bug.rs:63:13:
BUG: Instance::start_call called without a running event loop
If call_async is used, however, this works fine. This is something where the spec has changed over time where originally we could rely on normal component model traps to ensure that Func::call pretty much worked as expected, but with recent spec changes it effectively requires the event loop to be running and to activate fibers and such.
In essence a synchronous entrypoint for component model functions is no longer really compatible with the component model spec definition. I don't know exactly how to thread this needle myself, but we may want to consider deprecating Func::call.
- 主要语言
- Rust
- 星标
- 18.8k
- 派生
- 1.9k
- 平均合并
- 22 小时 54 分钟
- 30 天内合并 PR
- 371
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/wasmtime 的其他 Issue
-
bug wasm-proposal:exceptions wasmtime:debugging
难度 2/5 1-3 小时 新手友好度 76/100
bytecodealliance/wasmtime#14102 ·
维护者通常 1 天内回复
-
wasm-proposal:gc
难度 2/5 1-3 小时 新手友好度 62/100
bytecodealliance/wasmtime#13808 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 22/100
bytecodealliance/wasmtime#15105 · 2 条评论 ·
维护者通常 1 天内回复
-
bug wasmtime:c-api wasmtime:docs
难度 3/5 1-2 天 新手友好度 68/100
bytecodealliance/wasmtime#15088 · 1 条评论 ·
维护者通常 1 天内回复
-
Resolve builtins transitively可能已有人在做 @dyslexicsteak 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 20/100
bytecodealliance/wasmtime#15086 ·
维护者通常 1 天内回复
查看 bytecodealliance/wasmtime 的全部 Issue
相似的 Issue
-
area:docs documentation good first issue priority:medium
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
feature
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug]: streamed Responses API flex_unavailable error maps to 500 InternalServerError instead of 429未关闭llm translation
难度 2/5 1 小时以内 新手友好度 85/100
BerriAI/litellm#49736 · 1 条评论 ·
维护者通常 1 天内回复
-
question
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
field-report
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复