Skip to content

Commit 9735bcf

Browse files
committed
[fel] ensure thread release during channel cleanup by triggering completion
1 parent 62d49ba commit 9735bcf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

framework/fel/java/plugins/tool-mcp-server/src/main/java/modelengine/fel/tool/mcp/server/McpServerController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public McpServerController(@Fit(alias = "json") ObjectSerializer serializer, Mcp
9999
return;
100100
}
101101
toRemoved.forEach(this.responses::remove);
102-
toRemoved.forEach(this.emitters::remove);
102+
for (String s : toRemoved) {
103+
Emitter<TextEvent> removed = this.emitters.remove(s);
104+
removed.complete();
105+
}
103106
log.info("Channels are inactive, remove emitters and responses. [sessionIds={}]", toRemoved);
104107
}).build());
105108
}

0 commit comments

Comments
 (0)