Skip to content

Old processes aren't killed #209

Closed

Description

@Skn0tt

Describe the bug
Upon clicking the "Connect" button, a new server is spawned, but the old server isn't shut down.

To Reproduce
Steps to reproduce the behavior:

  1. Click "Connect"
  2. Click "Connect" again
  3. Observe that the child process for the first server is still running

Expected behavior

The child process for the first server should be shut down.

Logs

not applicable

Additional context

You need to call backingServerTransport.close() on the old backing server when you're starting up the new one. You should probably also clean up the proxy connection. Happy to contribute a PR.

Activity

  1. added
    bug
    on Mar 24, 2025
  2. cliffhall commented on Mar 24, 2025

    @cliffhall
    Member

    Hi @Skn0tt

    I tried this with both stdio and sse servers and didn't see any additional processes spawned.

    Can you provide more detailed steps to reproduce and/or screenshots?

  3. added
    waiting on submitter
    on Mar 25, 2025
  4. Skn0tt commented on Mar 25, 2025

    @Skn0tt
    ContributorAuthor
  5. cliffhall commented on Mar 25, 2025

    @cliffhall
    Member

    Excellent small world repro, @Skn0tt. I verified that two logs are created and the previous server process continues until the inspector is closed and both processes are killed.

    Two logs after clicking Connect again

    Image

    Two processes

    Image

    After closing the inspector, both processes are killed

    Image

    How to handle

    You need to call backingServerTransport.close() on the old backing server when you're starting up the new one. You should probably also clean up the proxy connection.

    Makes sense, however I question whether we should leave the Connect button enabled when there is an existing connection. I don't see the use in it, and clearly it is problematic.

    @olaservo Have you seen any use case that would break if we just disable the button once we have a connection? If no one has a good reason why, I say we head off this connection management issue by making the button aware of the connection state.

  6. removed
    waiting on submitter
    on Mar 25, 2025
  7. Skn0tt commented on Mar 26, 2025

    @Skn0tt
    ContributorAuthor

    I use the inspector while developing my MCP server, and the button is crucial for restarting the MCP server. So please don't disable it - but you could change its text to "Reconnect" or "Restart".

  8. cliffhall commented on Mar 26, 2025

    @cliffhall
    Member

    You need to call backingServerTransport.close() on the old backing server when you're starting up the new one. You should probably also clean up the proxy connection. Happy to contribute a PR.

    @Skn0tt Would you like to create a PR? I'll be happy to review it. I can do the PR if you'd like, but It is rewarding to fix the bug you found. :)

  9. added
    waiting on submitter
    on Mar 26, 2025
  10. Skn0tt commented on Mar 27, 2025

    @Skn0tt
    ContributorAuthor

    Sure, there you go: #216

  11. cliffhall commented on Mar 31, 2025

    @cliffhall
    Member

    Thanks, @Skn0tt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwaiting on submitter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions