You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address Copilot AI review - timeouts and CancelledError handling
Changes based on Copilot AI review (3 issues):
1. Increased thread join timeout (Issue #1):
- Changed from 2 to 5 seconds
- Made proportional to cleanup timeout
- Defined as class constant _THREAD_JOIN_TIMEOUT
2. Handle asyncio.CancelledError explicitly (Issue #2):
- Added separate except clause for CancelledError
- Logs specific warning for cancelled cleanup
- Re-raises CancelledError as per asyncio best practices
- Added for both session and stdio_context cleanup
3. Increased cleanup timeout to match connection timeout (Issue #3):
- Changed from 5 to 10 seconds (matches _connect_stdio timeout)
- Defined as class constant _CLEANUP_TIMEOUT
- Prevents incomplete cleanup with slow MCP servers
0 commit comments