Skip to content

Commit a39afbe

Browse files
committed
fix: separate TimeoutError handling for better error reporting
Per Copilot AI review: distinguish timeout scenarios from actual cleanup failures by catching TimeoutError separately. This helps with debugging by providing clearer error messages.
1 parent 7375b26 commit a39afbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/framework/runner/mcp_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ def disconnect(self) -> None:
436436
)
437437
cleanup_future.result(timeout=5) # Wait for cleanup with timeout
438438
cleanup_attempted = True
439+
except TimeoutError:
440+
# Cleanup took too long - may indicate stuck resources
441+
logger.warning("Async cleanup timed out after 5 seconds")
439442
except Exception as e:
440443
# This can happen if loop stopped between is_running() check and
441444
# run_coroutine_threadsafe(), or if cleanup itself failed

0 commit comments

Comments
 (0)