Skip to content

Commit 186ccdc

Browse files
committed
fix(rt-wasmtime): do not error on shutdown failure
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 7d58480 commit 186ccdc

5 files changed

Lines changed: 19 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ wit-component = { version = "0.215", default-features = false }
138138
wit-parser = { version = "0.215", default-features = false }
139139
wrpc-cli = { version = "0.2.1", path = "./crates/cli", default-features = false }
140140
wrpc-introspect = { version = "0.3", default-features = false, path = "./crates/introspect" }
141-
wrpc-runtime-wasmtime = { version = "0.20", path = "./crates/runtime-wasmtime", default-features = false }
141+
wrpc-runtime-wasmtime = { version = "0.20.1", path = "./crates/runtime-wasmtime", default-features = false }
142142
wrpc-transport = { version = "0.26.7", path = "./crates/transport", default-features = false }
143143
wrpc-transport-nats = { version = "0.22.3", path = "./crates/transport-nats", default-features = false }
144144
wrpc-transport-quic = { version = "0.1.1", path = "./crates/transport-quic", default-features = false }
145-
wrpc-wasmtime-nats-cli = { version = "0.5", path = "./crates/wasmtime-nats-cli", default-features = false }
145+
wrpc-wasmtime-nats-cli = { version = "0.5.1", path = "./crates/wasmtime-nats-cli", default-features = false }

crates/runtime-wasmtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wrpc-runtime-wasmtime"
3-
version = "0.20.0"
3+
version = "0.20.1"
44
description = "wRPC wasmtime integration"
55

66
authors.workspace = true

crates/runtime-wasmtime/src/lib.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,10 +1095,15 @@ where
10951095
)
10961096
.await
10971097
.context("failed to write asynchronous parameters")?;
1098-
pin!(outgoing)
1099-
.shutdown()
1098+
let mut outgoing = pin!(outgoing);
1099+
outgoing
1100+
.flush()
11001101
.await
1101-
.context("failed to shutdown outgoing stream")
1102+
.context("failed to flush outgoing stream")?;
1103+
if let Err(err) = outgoing.shutdown().await {
1104+
trace!(?err, "failed to shutdown outgoing stream")
1105+
}
1106+
anyhow::Ok(())
11021107
};
11031108
let rx = async {
11041109
let mut incoming = pin!(incoming);
@@ -1172,9 +1177,12 @@ where
11721177
tx.write_all(&buf)
11731178
.await
11741179
.context("failed to transmit results")?;
1175-
tx.shutdown()
1180+
tx.flush()
11761181
.await
1177-
.context("failed to shutdown outgoing stream")?;
1182+
.context("failed to flush outgoing stream")?;
1183+
if let Err(err) = tx.shutdown().await {
1184+
trace!(?err, "failed to shutdown outgoing stream")
1185+
}
11781186
try_join_all(
11791187
zip(0.., deferred)
11801188
.filter_map(|(i, f)| f.map(|f| (tx.index(&[i]), f)))

crates/wasmtime-nats-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wrpc-wasmtime-nats-cli"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
description = "wRPC Wasmtime NATS CLI"
55

66
authors.workspace = true

0 commit comments

Comments
 (0)