Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit c332300

Browse files
committed
Delete outdated test
1 parent 59319e5 commit c332300

File tree

2 files changed

+4
-153
lines changed

2 files changed

+4
-153
lines changed

spring-ai-mcp-core/src/main/java/org/springframework/ai/mcp/client/stdio/StdioServerTransport.java

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ public class StdioServerTransport extends AbstractMcpTransport {
5858

5959
private Scheduler errorScheduler;
6060

61-
volatile boolean isRunning;
62-
6361
private final ServerParameters params;
6462

6563
public StdioServerTransport(ServerParameters params) {
@@ -112,7 +110,6 @@ public void start() {
112110
}
113111

114112
// Start threads
115-
this.isRunning = true;
116113
startInboundProcessing();
117114
startOutboundProcessing();
118115
startErrorProcessing();
@@ -136,7 +133,7 @@ private void startErrorProcessing() {
136133
try (BufferedReader processErrorReader = new BufferedReader(
137134
new InputStreamReader(process.getErrorStream()))) {
138135
String line;
139-
while (isRunning && processErrorReader != null && (line = processErrorReader.readLine()) != null) {
136+
while ((line = processErrorReader.readLine()) != null) {
140137
try {
141138
System.out.println("Received error line: " + line);
142139
// TODO: handle errors, etc.
@@ -148,12 +145,7 @@ private void startErrorProcessing() {
148145
}
149146
}
150147
catch (IOException e) {
151-
if (this.isRunning) {
152-
throw new RuntimeException(e);
153-
}
154-
}
155-
finally {
156-
this.isRunning = false;
148+
throw new RuntimeException(e);
157149
}
158150
});
159151
}
@@ -162,7 +154,7 @@ private void startInboundProcessing() {
162154
this.inboundScheduler.schedule(() -> {
163155
try (BufferedReader processReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
164156
String line;
165-
while (this.isRunning && processReader != null && (line = processReader.readLine()) != null) {
157+
while ((line = processReader.readLine()) != null) {
166158
try {
167159
JSONRPCMessage message = deserializeJsonRpcMessage(line);
168160
if (!this.getInboundSink().tryEmitNext(message).isSuccess()) {
@@ -176,12 +168,7 @@ private void startInboundProcessing() {
176168
}
177169
}
178170
catch (IOException e) {
179-
if (isRunning) {
180-
throw new RuntimeException(e);
181-
}
182-
}
183-
finally {
184-
isRunning = false;
171+
throw new RuntimeException(e);
185172
}
186173
});
187174
}
@@ -230,8 +217,6 @@ private void startOutboundProcessing() {
230217
@Override
231218
public Mono<Void> closeGracefully() {
232219

233-
this.isRunning = false;
234-
235220
return Mono.fromFuture(() -> {
236221
System.out.println("Sending TERM to process");
237222
if (this.process != null) {

spring-ai-mcp-core/src/test/java/org/springframework/ai/mcp/client/stdio/StdioServerTransportTests.java

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)