Skip to content

Conversation

@cliffhall
Copy link
Member

Description

  • In index.ts

    • added a variable to hold the initialize timeout
    • store the timeout in the oninitialized handler
    • clear the timeout in the cleanup callback
  • In roots.ts

    • In the catch block of syncRoots, log the error to the console via .error rather than attempting to send to the client because the most probable case here is that we don't have a connection.
  • In simulate-research-query.ts

    • remove redundant local variable in getTask
  • Everywhere else, prettier.

Server Details

  • Server: everything
  • Changes to: server factory

Motivation and Context

Fixes #3234 -"Everything Server crashes when multiple clients reconnect"
The crash occurs due to a race condition between session cleanup and asynchronous operations.

How Has This Been Tested?

Tested locally

Breaking Changes

Nope.

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 Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

"Everything Server crashes when multiple clients reconnect"

* In index.ts
  - added a variable to hold the initialize timeout
  - store the timeout in the oninitialized handler
  - clear the timeout in the cleanup callback

* In roots.ts
  - In the catch block of syncRoots, log the error to the console via .error rather than attempting to send to the client because the most probable case here is that we don't have a connection.

* In simulate-research-query.ts
  - remove redundant local variable in getTask
* Everywhere else, prettier.
"Everything Server crashes when multiple clients reconnect"

* In index.ts
  - added a variable to hold the initialize timeout
  - store the timeout in the oninitialized handler
  - clear the timeout in the cleanup callback

* In roots.ts
  - In the catch block of syncRoots, log the error to the console via .error rather than attempting to send to the client because the most probable case here is that we don't have a connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Everything Server crashes when multiple clients reconnect

1 participant