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
[fel] Improve McpClient lifecycle management with closed state tracking
- Added a closed flag to DefaultMcpClient to track client lifecycle state.
- Prevent method invocations after closure by adding checks in initialize(), getTools(), and callTool().
- Safely handle potential nulls in close() to avoid exceptions during partial initialization.
- Ensures consistent behavior and prevents resource leaks or usage after the client has been closed.
This change improves reliability and correctness by enforcing proper usage of the MCP client throughout its lifecycle.
Copy file name to clipboardExpand all lines: framework/fel/java/plugins/tool-mcp-client/src/main/java/modelengine/fel/tool/mcp/client/support/DefaultMcpClient.java
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,7 @@ public class DefaultMcpClient implements McpClient {
0 commit comments