mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-30 16:19:21 +00:00
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:
+10
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user