Title: Add idle session cleanup to prevent unbounded session accumulation by ddworken · Pull Request #1343 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Add idle session cleanup to prevent unbounded session accumulation by ddworken · Pull Request #1343 · modelcontextprotocol/python-sdk
X Title: Add idle session cleanup to prevent unbounded session accumulation by ddworken · Pull Request #1343 · modelcontextprotocol/python-sdk
Description: Summary Added automatic cleanup of idle sessions when session count exceeds threshold Sessions inactive longer than idle timeout are terminated to free resources Prevents memory exhaustion from clients that create sessions but never terminate them Changes Added configurable session idle timeout (default 30 minutes) Added background cleanup task that activates when session count > 10k Track last activity time for each session Double-check idle status before cleanup to prevent race conditions Testing Added tests for idle session cleanup behavior Added tests for threshold-based activation Added tests for session activity tracking All existing tests continue to pass This ensures the server remains stable even when clients don't properly close their sessions.
Open Graph Description: Summary Added automatic cleanup of idle sessions when session count exceeds threshold Sessions inactive longer than idle timeout are terminated to free resources Prevents memory exhaustion from cl...
X Description: Summary Added automatic cleanup of idle sessions when session count exceeds threshold Sessions inactive longer than idle timeout are terminated to free resources Prevents memory exhaustion from cl...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1343
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7563a91f-fcaf-39bf-27e6-aa0089de5b32 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8298:217B56:2EB366:3E5648:6A5B4C3C |
| html-safe-nonce | a5b865afd315332c6c09496948b659185758b741a837fb0f51147936c14f196f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjk4OjIxN0I1NjoyRUIzNjY6M0U1NjQ4OjZBNUI0QzNDIiwidmlzaXRvcl9pZCI6IjQ4MzAwMDMyNTgwMjE1OTYyMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fb54e2cd6dbdaae0ea78686a5daa97ae43292459889aa74be621594014f1f1e3 |
| hovercard-subject-tag | pull_request:2801066639 |
| 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/1343/files |
| twitter:image | https://avatars.githubusercontent.com/u/5304541?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5304541?s=400&v=4 |
| og:image:alt | Summary Added automatic cleanup of idle sessions when session count exceeds threshold Sessions inactive longer than idle timeout are terminated to free resources Prevents memory exhaustion from cl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width