From bd1cc7fa50be84fddf60d181d081de11988ed1bc Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:02:15 -0400 Subject: [PATCH] Add more data to see which extension got leaked (cherry-pick #35272) (#35278) Cherry-picked Add more data to see which extension got leaked (#35272) Part of https://github.com/zed-industries/zed/issues/35185 Release Notes: - N/A Co-authored-by: Kirill Bulatov --- crates/extension_host/src/wasm_host.rs | 29 ++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/crates/extension_host/src/wasm_host.rs b/crates/extension_host/src/wasm_host.rs index 3e0f06fa38..eb852f4259 100644 --- a/crates/extension_host/src/wasm_host.rs +++ b/crates/extension_host/src/wasm_host.rs @@ -755,8 +755,18 @@ impl WasmExtension { } .boxed() })) - .expect("wasm extension channel should not be closed yet"); - return_rx.await.expect("wasm extension channel") + .unwrap_or_else(|_| { + panic!( + "wasm extension channel should not be closed yet, extension {} (id {})", + self.manifest.name, self.manifest.id, + ) + }); + return_rx.await.unwrap_or_else(|_| { + panic!( + "wasm extension channel, extension {} (id {})", + self.manifest.name, self.manifest.id, + ) + }) } } @@ -777,8 +787,19 @@ impl WasmState { } .boxed_local() })) - .expect("main thread message channel should not be closed yet"); - async move { return_rx.await.expect("main thread message channel") } + .unwrap_or_else(|_| { + panic!( + "main thread message channel should not be closed yet, extension {} (id {})", + self.manifest.name, self.manifest.id, + ) + }); + let name = self.manifest.name.clone(); + let id = self.manifest.id.clone(); + async move { + return_rx.await.unwrap_or_else(|_| { + panic!("main thread message channel, extension {name} (id {id})") + }) + } } fn work_dir(&self) -> PathBuf {