René's URL Explorer Experiment


Title: fix(http): wait for active requests during shutdown by jonxsong · Pull Request #3882 · github/github-mcp-server · GitHub

Open Graph Title: fix(http): wait for active requests during shutdown by jonxsong · Pull Request #3882 · github/github-mcp-server

X Title: fix(http): wait for active requests during shutdown by jonxsong · Pull Request #3882 · github/github-mcp-server

Description: Summary Wait for active Streamable HTTP requests to finish during CLI shutdown. If the five-second grace period expires, close the remaining connections and return the shutdown error. Why On SIGTERM or SIGINT, RunHTTPServer started http.Server.Shutdown in a goroutine. Go closes the listener before waiting for active handlers, so ListenAndServe returned http.ErrServerClosed while the drain was in progress. The CLI then logged server stopped gracefully and could exit before the SDK wrote the MCP response. A client could receive EOF even when its GitHub API request could have completed inside the grace period. Go Server.Shutdown documentation The reproduction used the Linux CLI from 4e6e6c053e48, a normal MCP get_me call, and a local GitHub API stub. The stub held /api/v3/user until after SIGTERM closed the listener. With the response still blocked, the original process logged graceful shutdown and exited with status 0. The caller received EOF. Under the same sequence, the fixed process waited for the stub, delivered JSON-RPC result ID 42, and then exited with status 0. With the stub held past the full grace period, the fixed CLI reported context deadline exceeded and exited with status 1 after approximately five seconds. The MCP client connection closed and the GitHub stub observed request cancellation. What changed Run the HTTP serve loop in a goroutine and wait for both the serve loop and graceful shutdown before returning to the CLI. Keep the five-second deadline independent of the signal context so in-flight HTTP requests can finish. After a shutdown error, force-close any remaining connections and surface the error. Exercise four paths using real net/http handlers, net.Pipe, and testing/synctest. The tests cover response delivery during drain, connection closure and request cancellation at the grace deadline, listener errors, and cancellation before serving. Restoring the old shutdown ordering in a temporary overlay made the drain and deadline regressions fail on their expected assertions. MCP impact No tool or API changes. The patch is limited to the lifecycle of the self-hosted HTTP CLI. The Go SDK continues to own Streamable HTTP request and session handling, and tool calls still use their request contexts. Prompts tested (tool changes only) The transport reproduction uses the existing get_me tool against a loopback API stub. Security / limits Auth / permissions considered. Requests continue to pass through the existing bearer-token middleware and tool authorization. Shutdown retains its five-second grace period. Tool renaming I am not renaming tools as part of this PR. Lint & tests Linted locally with ./script/lint on Linux using the pinned golangci-lint v2.14.0. Tested locally with ./script/test (go test -race ./...) on Linux. Windows, Go 1.27.4 — go test -run '^TestServeHTTP' -count=100 -timeout 60s ./pkg/http, go test -v ./..., and UPDATE_TOOLSNAPS=true go test ./.... The verbose run passed 32 packages, 1,207 top-level tests, and 7,825 subtests. The snapshot pass produced no tracked changes. Linux, Go 1.27.4 — go test -race -run '^TestServeHTTP' -count=100 -timeout 60s ./pkg/http, go mod tidy -diff, and a CLI build. The CLI also built on Windows. The signal-to-response reproduction ran on Linux. Docs Not needed. script/generate-docs reproduced all five checked-in documentation files it generates. Skills Confirmed no bundled skill applies to the HTTP CLI shutdown lifecycle. Streamable HTTP CLI mode was introduced in #1849. AI assistance was used to investigate and reproduce the defect, author the fix and tests, review the diff, and draft this description.

Open Graph Description: Summary Wait for active Streamable HTTP requests to finish during CLI shutdown. If the five-second grace period expires, close the remaining connections and return the shutdown error. Why On SIGTER...

X Description: Summary Wait for active Streamable HTTP requests to finish during CLI shutdown. If the five-second grace period expires, close the remaining connections and return the shutdown error. Why On SIGTER...

Opengraph URL: https://github.com/github/github-mcp-server/pull/3882

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4f3544d6-8d1a-92c6-c60e-1e3af0fc1d68
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8C58:144D14:28AE63:371067:6B0616EA
html-safe-nonce228edff2117ef6c29b6a7dc6e21e8a9beb289a03a69c3f166c0c661873def202
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzU4OjE0NEQxNDoyOEFFNjM6MzcxMDY3OjZCMDYxNkVBIiwidmlzaXRvcl9pZCI6IjQxNjE1MjE3NzQ4NTA2MTA5MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac00d3f84a216c0e65379484cc3cba3e77f1fcf68a5af610d03710996eeccbc463
hovercard-subject-tagpull_request:5372499682
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/github-mcp-server/pull/3882/files
twitter:imagehttps://avatars.githubusercontent.com/u/45381472?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/45381472?s=400&v=4
og:image:altSummary Wait for active Streamable HTTP requests to finish during CLI shutdown. If the five-second grace period expires, close the remaining connections and return the shutdown error. Why On SIGTER...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id942771284
octolytics-dimension-repository_nwogithub/github-mcp-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id942771284
octolytics-dimension-repository_network_root_nwogithub/github-mcp-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release866f202ebf7ac5aff8f633417d9fd8a53818a977
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/github-mcp-server/pull/3882/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F3882%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F3882%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/pull/3882/files
Reloadhttps://github.com/github/github-mcp-server/pull/3882/files
Reloadhttps://github.com/github/github-mcp-server/pull/3882/files
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues238 (238)https://github.com/github/github-mcp-server/issues
Pull requests226 (226)https://github.com/github/github-mcp-server/pulls
Discussionshttps://github.com/github/github-mcp-server/discussions
Actionshttps://github.com/github/github-mcp-server/actions
Security and quality2 (2)https://github.com/github/github-mcp-server/security
Insightshttps://github.com/github/github-mcp-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
jonxsonghttps://github.com/jonxsong
github:mainhttps://github.com/github/github-mcp-server/tree/main
jonxsong:codex/fix-http-graceful-shutdownhttps://github.com/jonxsong/github-mcp-server/tree/codex/fix-http-graceful-shutdown
Conversation 1 https://github.com/github/github-mcp-server/pull/3882
Commits 1 https://github.com/github/github-mcp-server/pull/3882/commits
Checks 1 https://github.com/github/github-mcp-server/pull/3882/checks
Findings https://github.com/github/github-mcp-server/pull/3882/findings
Files changed https://github.com/github/github-mcp-server/pull/3882/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3882/files
fix(http): wait for active requests during shutdown https://github.com/github/github-mcp-server/pull/3882/files#top
Show all changes 1 commit https://github.com/github/github-mcp-server/pull/3882/files
c866dd6 fix(http): wait for active requests during shutdown jonxsong Nov 18, 2026 https://github.com/github/github-mcp-server/pull/3882/commits/c866dd6a1f63f8754f5733240a3eb7a7541d08ab
Clear filters https://github.com/github/github-mcp-server/pull/3882/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3882/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/3882/files
server.go https://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
shutdown_test.go https://github.com/github/github-mcp-server/pull/3882/files#diff-447f6b4b25f82c93cf8db4bf1aad2cde0657af14f862f01729b77c5b6a0a16eb
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/http/server.gohttps://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
View file https://github.com/github/github-mcp-server/blob/c866dd6a1f63f8754f5733240a3eb7a7541d08ab/pkg/http/server.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3882/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
https://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
https://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
https://github.com/github/github-mcp-server/pull/3882/files#diff-012838e0102e94f167e4c523990093e0d482d6a2ab18b28f0c0cb593177009d6
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/http/shutdown_test.gohttps://github.com/github/github-mcp-server/pull/3882/files#diff-447f6b4b25f82c93cf8db4bf1aad2cde0657af14f862f01729b77c5b6a0a16eb
View file https://github.com/github/github-mcp-server/blob/c866dd6a1f63f8754f5733240a3eb7a7541d08ab/pkg/http/shutdown_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/3882/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.