diff --git a/common/client-core/src/client/base_client/mod.rs b/common/client-core/src/client/base_client/mod.rs index 9ea8fc27e4a..0579cc12a8a 100644 --- a/common/client-core/src/client/base_client/mod.rs +++ b/common/client-core/src/client/base_client/mod.rs @@ -430,7 +430,7 @@ where Err(ClientCoreError::CustomGatewaySelectionExpected) } else { // and make sure to invalidate the task client so we wouldn't cause premature shutdown - //shutdown.disarm(); + shutdown.disarm(); custom_gateway_transceiver.set_packet_router(packet_router)?; Ok(custom_gateway_transceiver) }; @@ -536,7 +536,7 @@ where if topology_config.disable_refreshing { // if we're not spawning the refresher, don't cause shutdown immediately info!("The topology refesher is not going to be started"); - //shutdown.disarm(); + shutdown.disarm(); } else { // don't spawn the refresher if we don't want to be refreshing the topology. // only use the initial values obtained diff --git a/common/client-libs/gateway-client/src/socket_state.rs b/common/client-libs/gateway-client/src/socket_state.rs index d7754c5341a..7911f337978 100644 --- a/common/client-libs/gateway-client/src/socket_state.rs +++ b/common/client-libs/gateway-client/src/socket_state.rs @@ -20,6 +20,7 @@ use tungstenite::{protocol::Message, Error as WsError}; use si_scale::helpers::bibytes2; #[cfg(unix)] use std::os::fd::AsRawFd; +use std::time::Duration; #[cfg(not(target_arch = "wasm32"))] use tokio::net::TcpStream; #[cfg(not(target_arch = "wasm32"))] @@ -285,7 +286,20 @@ impl PartiallyDelegatedHandle { &mut self, msg: Message, ) -> Result<(), GatewayClientError> { - Ok(self.sink_half.send(msg).await?) + + log::info!("JON: PartiallyDelegated::send_without_response - sending a message"); + // let r = self.sink_half.send(msg).await; + // Ok(r?) + let r = tokio::time::timeout(Duration::from_secs(3), self.sink_half.send(msg)).await; + let rr = match r { + Ok(rr) => Ok(rr?), + Err(_) => { + log::error!("JON: PartiallyDelegated::send_without_response - timeout sending a message"); + Err(GatewayClientError::Timeout) + } + }; + log::info!("JON: PartiallyDelegated::send_without_response - sent a message: {rr:?}"); + rr } pub(crate) async fn batch_send_without_response(