Remove outer handler mutex from exec-server RPC base

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-03-18 14:34:21 -07:00
parent c5dbe421bb
commit 66f49ea604
4 changed files with 20 additions and 31 deletions

View File

@@ -1,6 +1,5 @@
use std::sync::Arc;
use tokio::sync::Mutex;
use tokio::sync::mpsc;
use tracing::debug;
use tracing::warn;
@@ -21,7 +20,7 @@ pub(crate) async fn run_connection(connection: JsonRpcConnection) {
let (outgoing_tx, mut outgoing_rx) =
mpsc::channel::<RpcServerOutboundMessage>(CHANNEL_CAPACITY);
let notifications = RpcNotificationSender::new(outgoing_tx.clone());
let handler = Arc::new(Mutex::new(ExecServerHandler::new(notifications)));
let handler = Arc::new(ExecServerHandler::new(notifications));
let outbound_task = tokio::spawn(async move {
while let Some(message) = outgoing_rx.recv().await {
@@ -101,7 +100,7 @@ pub(crate) async fn run_connection(connection: JsonRpcConnection) {
}
}
handler.lock().await.shutdown().await;
handler.shutdown().await;
drop(outgoing_tx);
let _ = outbound_task.await;
}