mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +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:
1 parent
2584e88cad
commit
312b62ac95
2 files changed
+2
No files matched your search
@@ -154,6 +154,7 @@ impl Session {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Publishes changed MCP state, waiting for any refresh already in progress.
|
/// 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>) {
|
pub(crate) async fn refresh_mcp_if_dirty(self: &Arc<Self>) {
|
||||||
let Ok(_refresh) = self.mcp_refresh.acquire().await else {
|
let Ok(_refresh) = self.mcp_refresh.acquire().await else {
|
||||||
error!("MCP runtime refresh semaphore closed");
|
error!("MCP runtime refresh semaphore closed");
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ impl McpRefresh {
|
|||||||
self.pending.swap(false, Ordering::AcqRel)
|
self.pending.swap(false, Ordering::AcqRel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(name = "mcp.runtime.refresh_wait", skip_all)]
|
||||||
pub(super) async fn acquire(&self) -> Result<SemaphorePermit<'_>, AcquireError> {
|
pub(super) async fn acquire(&self) -> Result<SemaphorePermit<'_>, AcquireError> {
|
||||||
self.gate.acquire().await
|
self.gate.acquire().await
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user