Title: Non initialized McpServerSession hangs and timesout instead of providing helpful error message · Issue #275 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Non initialized McpServerSession hangs and timesout instead of providing helpful error message · Issue #275 · modelcontextprotocol/java-sdk
X Title: Non initialized McpServerSession hangs and timesout instead of providing helpful error message · Issue #275 · modelcontextprotocol/java-sdk
Description: This issue is closely related to #274 and could be considered as a follow up to that, but I decided to split it for convenience and readability. Calling McpServerSession#handle(JSonRPCMessage) on an instance that hasn't yet received the ...
Open Graph Description: This issue is closely related to #274 and could be considered as a follow up to that, but I decided to split it for convenience and readability. Calling McpServerSession#handle(JSonRPCMessage) on a...
X Description: This issue is closely related to #274 and could be considered as a follow up to that, but I decided to split it for convenience and readability. Calling McpServerSession#handle(JSonRPCMessage) on a...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/275
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Non initialized McpServerSession hangs and timesout instead of providing helpful error message","articleBody":"This issue is closely related to #274 and could be considered as a follow up to that, but I decided to split it for convenience and readability.\n\nCalling `McpServerSession#handle(JSonRPCMessage)` on an instance that hasn't yet received the `notifications/initialized` notification results in a Mono that never completes until a Timeout is raised.\n\nThis happens because the `io.modelcontextprotocol.spec.McpServerSession#exchangeSink` will never emit any value until such notification is received, and thus the `this.exchangeSink.asMono().flatMap(exchange -\u003e handler.handle(exchange, request.params()));` in `McpServerSession#225` will never complete. \n\nPutting the considerations of #274 aside, it is fair for a non intiailized session to not handle messages, but it should do it by quickly returning a `Mono.error` instead of hanging and returning an unspecified timeout. \n\n","author":{"url":"https://github.com/marianogonzalez","@type":"Person","name":"marianogonzalez"},"datePublished":"2025-05-28T16:23:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/275/java-sdk/issues/275"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:671fe596-1d3a-4cc0-c575-757057dd10ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA98:2009F3:93C9B:C21DD:6A5BE4FE |
| html-safe-nonce | 3022138d25f53aa09b7420362de2f17dc54bdff3c1e787e4279d31ce47e619ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTk4OjIwMDlGMzo5M0M5QjpDMjFERDo2QTVCRTRGRSIsInZpc2l0b3JfaWQiOiI1MTEyMTQyMzM1NDYwNTAwNzM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2f1426bd2aeaefc0abb13d87ae2522fa18095fbf693d97b2005275d9165f7f74 |
| hovercard-subject-tag | issue:3097912776 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/modelcontextprotocol/java-sdk/275/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa22dc6c537f1e57695df3d9e2a2d3596e47a078533b099d186e59deb4531159/modelcontextprotocol/java-sdk/issues/275 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa22dc6c537f1e57695df3d9e2a2d3596e47a078533b099d186e59deb4531159/modelcontextprotocol/java-sdk/issues/275 |
| og:image:alt | This issue is closely related to #274 and could be considered as a follow up to that, but I decided to split it for convenience and readability. Calling McpServerSession#handle(JSonRPCMessage) on a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | marianogonzalez |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| 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