Title: Improve child process termination on POSIX & Windows by felixweinberger · Pull Request #1078 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Improve child process termination on POSIX & Windows by felixweinberger · Pull Request #1078 · modelcontextprotocol/python-sdk
X Title: Improve child process termination on POSIX & Windows by felixweinberger · Pull Request #1078 · modelcontextprotocol/python-sdk
Description: Motivation and Context #729, and #850 address important failures to shut down childprocesses when MCP servers spawn subprocesses. This is not a trivial thing to fix, as there's no great cross-platform library for terminating process-trees on all platforms so we have to fork between Unix (using os.killpg) and Windows (using JobObjects via pywin32 which is the best supported external library for this: https://github.com/mhammond/pywin32) This PR adds regressions tests to clearly demonstrate the edge cases addressed + unifies the approaches from the PRs listed above. How Has This Been Tested? New regression tests added (each fails without the relevant fix). These were developed and tested on both POSIX and Windows systems. For #729 and #850 (properly terminate processes and their children across platforms): Original authors: @jingx8885, @surya-prakash-susarla Breaking Changes None. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context
Open Graph Description: Motivation and Context #729, and #850 address important failures to shut down childprocesses when MCP servers spawn subprocesses. This is not a trivial thing to fix, as there's no great cross-...
X Description: Motivation and Context #729, and #850 address important failures to shut down childprocesses when MCP servers spawn subprocesses. This is not a trivial thing to fix, as there's no great cr...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1078
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:92ae0f54-aa3f-070d-d67f-7b1b28e9ddc3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B876:187CAA:22A881:2F66AA:6A5A5BC7 |
| html-safe-nonce | 12c570ec6b52fd7460fd26ae8b8e8dc1c986797036fe7c5dd6e36fabee5aca0d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODc2OjE4N0NBQToyMkE4ODE6MkY2NkFBOjZBNUE1QkM3IiwidmlzaXRvcl9pZCI6IjkwNDk4MTEwMTc1MTcyMDkwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 404eb98521c1b9e6fb120a4fbd486dd44f1f10f8ce62853e8c2e699c975228ee |
| hovercard-subject-tag | pull_request:2638246606 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/1078/files |
| twitter:image | https://avatars.githubusercontent.com/u/3823880?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3823880?s=400&v=4 |
| og:image:alt | Motivation and Context #729, and #850 address important failures to shut down childprocesses when MCP servers spawn subprocesses. This is not a trivial thing to fix, as there's no great cross-... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 05b9ddf6a47d2dbe13944873a99f5fb4b83ba4871f9cb8a8e256793a63ca9687 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8d29d1bd03dda2dd14b3f80b8bc27e1111f43bd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width