fix(webhook): avoid lock-held awaits in server lifecycle paths (#1168)

* fix(webhook): avoid holding mutex across async shutdown

* test(webhook): add regression coverage for begin_shutdown split path

* test(webhook): satisfy no-panics rule in begin_shutdown regression
This commit is contained in:
Nige
2026-03-14 13:06:24 -07:00
committed by GitHub
parent 7c017ea6fd
commit 8dfad332d9
2 changed files with 48 additions and 3 deletions
+10 -1
View File
@@ -920,7 +920,16 @@ async fn async_main() -> anyhow::Result<()> {
}
if let Some(ref ws_arc) = webhook_server {
ws_arc.lock().await.shutdown().await;
let (shutdown_tx, handle) = {
let mut ws = ws_arc.lock().await;
ws.begin_shutdown()
};
if let Some(tx) = shutdown_tx {
let _ = tx.send(());
}
if let Some(handle) = handle {
let _ = handle.await;
}
}
if let Some(tunnel) = active_tunnel {