mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Trace MCP runtime refresh coordination (#39667)
## What changed Add named tracing spans for MCP dirty-state refreshes and time spent waiting to acquire the refresh semaphore. GitOrigin-RevId: 1dbb3572d2061581beb83b3de098d6ec91791104
This commit is contained in:
@@ -154,6 +154,7 @@ impl Session {
|
||||
}
|
||||
|
||||
/// Publishes changed MCP state, waiting for any refresh already in progress.
|
||||
#[tracing::instrument(name = "mcp.runtime.refresh_if_dirty", skip_all)]
|
||||
pub(crate) async fn refresh_mcp_if_dirty(self: &Arc<Self>) {
|
||||
let Ok(_refresh) = self.mcp_refresh.acquire().await else {
|
||||
error!("MCP runtime refresh semaphore closed");
|
||||
|
||||
@@ -30,6 +30,7 @@ impl McpRefresh {
|
||||
self.pending.swap(false, Ordering::AcqRel)
|
||||
}
|
||||
|
||||
#[tracing::instrument(name = "mcp.runtime.refresh_wait", skip_all)]
|
||||
pub(super) async fn acquire(&self) -> Result<SemaphorePermit<'_>, AcquireError> {
|
||||
self.gate.acquire().await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user