Skip to content

Commit 22e2b3a

Browse files
authored
Fix the TaskGroup hanging on stdin_writer when stdio_client exiting
Triggers a TaskGroup cancel after reaching the finally code block.
1 parent babb477 commit 22e2b3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mcp/client/stdio/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ async def stdin_writer():
177177
await terminate_windows_process(process)
178178
else:
179179
process.terminate()
180+
tg.cancel_scope.cancel()
180181

181182

182183
def _get_executable_command(command: str) -> str:

0 commit comments

Comments
 (0)