From c5040bd0a43f5835b3bb93d33ce26139c1dd0e51 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 20 Aug 2025 15:41:58 +0200 Subject: [PATCH] remote: Do not leave client hanging on unhandled proto message (#36590) Otherwise the client will wait for a response that never arrives, causing the task to lock up Release Notes: - N/A --- crates/remote/src/ssh_session.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs index 1c4409aec3..a26f4be661 100644 --- a/crates/remote/src/ssh_session.rs +++ b/crates/remote/src/ssh_session.rs @@ -2353,6 +2353,7 @@ impl ChannelClient { build_typed_envelope(peer_id, Instant::now(), incoming) { let type_name = envelope.payload_type_name(); + let message_id = envelope.message_id(); if let Some(future) = ProtoMessageHandlerSet::handle_message( &this.message_handlers, envelope, @@ -2391,6 +2392,15 @@ impl ChannelClient { .detach() } else { log::error!("{}:unhandled ssh message name:{type_name}", this.name); + if let Err(e) = AnyProtoClient::from(this.clone()).send_response( + message_id, + anyhow::anyhow!("no handler registered for {type_name}").to_proto(), + ) { + log::error!( + "{}:error sending error response for {type_name}:{e:#}", + this.name + ); + } } } }