Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/trigger-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ terminal = { path = "../terminal" }
tokio = { workspace = true, features = ["full"] }
tokio-rustls = { workspace = true }
tracing = { workspace = true }
wasmtime = { workspace = true }
wasmtime-wasi = { workspace = true }
wasmtime-wasi-http = { workspace = true }

Expand Down
17 changes: 16 additions & 1 deletion crates/trigger-http/src/wasip3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{
};
use tokio::task;
use tracing::{instrument, Instrument, Level};
use wasmtime::Trap;
use wasmtime_wasi_http::{
body::HyperIncomingBody as Body,
p3::{
Expand Down Expand Up @@ -84,7 +85,21 @@ impl HttpExecutor for Wasip3HttpExecutor<'_> {
.in_current_span()
.inspect(|result| {
if let Err(error) = result {
tracing::error!("Component error handling request: {error:?}");
// TODO: Remove this check once we've updated to Wasmtime
// 38+.
//
// Wasmtime 37's implementation of
// `Instance::run_concurrent` returns `Trap::AsyncDeadlock`
// if the `AsyncFnOnce` it was given does not resolve by the
// time all outstanding tasks have finished. In this case,
// it's harmless and we can ignore it. See
// https://github.com/bytecodealliance/wasmtime/pull/11756
// for details.
if let Some(Trap::AsyncDeadlock) = error.downcast_ref::<Trap>() {
// ignore
} else {
tracing::error!("Component error handling request: {error:?}");
}
}
}),
);
Expand Down