From 4756d3e9fba4dd8b529000cd5688c105ca3e70e4 Mon Sep 17 00:00:00 2001 From: stevelr Date: Tue, 10 May 2022 20:02:57 -0700 Subject: [PATCH] observe host default rpc timeout in all cases (#99) bump wasmbus-rpc to 0.8.5 Signed-off-by: stevelr --- rpc-rs/Cargo.toml | 4 ++-- rpc-rs/src/provider.rs | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/rpc-rs/Cargo.toml b/rpc-rs/Cargo.toml index 4221aa9..5ef53aa 100644 --- a/rpc-rs/Cargo.toml +++ b/rpc-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmbus-rpc" -version = "0.8.4" +version = "0.8.5" authors = [ "wasmcloud Team" ] license = "Apache-2.0" description = "Runtime library for actors and capability providers" @@ -34,7 +34,7 @@ thiserror = "1.0" time = "0.3.7" tokio-timer = "0.2" toml = "0.5" -tracing = { version = "0.1", features = ["log"] } +tracing = { version = "0.1.34", features = ["log"] } tracing-futures = "0.2" wasmbus-macros = { path = "../macros", version = "0.1.8" } minicbor-ser = "0.1.2" diff --git a/rpc-rs/src/provider.rs b/rpc-rs/src/provider.rs index b3da2c6..76cb316 100644 --- a/rpc-rs/src/provider.rs +++ b/rpc-rs/src/provider.rs @@ -164,7 +164,9 @@ impl HostBridge { &host_data.lattice_rpc_prefix, key, host_data.host_id.clone(), - None, + host_data + .default_rpc_timeout_ms + .map(|ms| Duration::from_millis(ms as u64)), ); Ok(HostBridge { @@ -832,16 +834,17 @@ impl<'send> ProviderTransport<'send> { ) -> Self { #[allow(clippy::redundant_closure)] let bridge = bridge.unwrap_or_else(|| crate::provider_main::get_host_bridge()); + let timeout = StdMutex::new(timeout.unwrap_or_else(|| { + bridge + .host_data + .default_rpc_timeout_ms + .map(|t| Duration::from_millis(t as u64)) + .unwrap_or(DEFAULT_RPC_TIMEOUT_MILLIS) + })); Self { bridge, ld, - timeout: StdMutex::new(timeout.unwrap_or_else(|| { - bridge - .host_data - .default_rpc_timeout_ms - .map(|t| Duration::from_millis(t as u64)) - .unwrap_or(DEFAULT_RPC_TIMEOUT_MILLIS) - })), + timeout, } } }