Skip to content

Commit ff9da9d

Browse files
SomeoneToIgnoreJosephTLyons
authored andcommitted
Add more data to see which extension got leaked (#35272)
Part of #35185 Release Notes: - N/A
1 parent 271055a commit ff9da9d

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

crates/extension_host/src/wasm_host.rs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,18 @@ impl WasmExtension {
755755
}
756756
.boxed()
757757
}))
758-
.expect("wasm extension channel should not be closed yet");
759-
return_rx.await.expect("wasm extension channel")
758+
.unwrap_or_else(|_| {
759+
panic!(
760+
"wasm extension channel should not be closed yet, extension {} (id {})",
761+
self.manifest.name, self.manifest.id,
762+
)
763+
});
764+
return_rx.await.unwrap_or_else(|_| {
765+
panic!(
766+
"wasm extension channel, extension {} (id {})",
767+
self.manifest.name, self.manifest.id,
768+
)
769+
})
760770
}
761771
}
762772

@@ -777,8 +787,19 @@ impl WasmState {
777787
}
778788
.boxed_local()
779789
}))
780-
.expect("main thread message channel should not be closed yet");
781-
async move { return_rx.await.expect("main thread message channel") }
790+
.unwrap_or_else(|_| {
791+
panic!(
792+
"main thread message channel should not be closed yet, extension {} (id {})",
793+
self.manifest.name, self.manifest.id,
794+
)
795+
});
796+
let name = self.manifest.name.clone();
797+
let id = self.manifest.id.clone();
798+
async move {
799+
return_rx.await.unwrap_or_else(|_| {
800+
panic!("main thread message channel, extension {name} (id {id})")
801+
})
802+
}
782803
}
783804

784805
fn work_dir(&self) -> PathBuf {

0 commit comments

Comments
 (0)