Skip to content

Socket transport: "Connection refused" without host and port, and fast restarts #1944

Closed

Description

@muescha

A follow-up of #1870, collected in #1943.

Update: #1966 (in 0.30.0) catches the ConnectException of an attach and names the host and port: "Nothing listens on 127.0.0.1:6010 (Connection refused): …". The pause between restarts and the notice when the server is disabled are still open. (done in #1977 and #1985)

When attach times out, the message names host:port. When nothing listens there, the ConnectException goes up as is, so the LSP console and the notification only show java.net.ConnectException: Connection refused, without the host and port:

The Notifications tool window with "Demo LSP (attach): Cannot start server" and "java.net.ConnectException: Connection refused", without host and port

With nothing listening on the port, I got about 20 of these stack traces in a row: LanguageServerWrapper restarts up to MAX_NUMBER_OF_RESTART_ATTEMPTS = 20 times with no pause, each time something calls start(), and then disables the server. That's not new; a server that can't start over stdio does the same. But with attach, "not started yet" is a normal state, so it shows more often.

Ideas:

How this was checked

Seen in runIde with the attach transport and nothing listening on the port: about 20 stack traces in a row. The code references were checked against b4b23c2 by Claude Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions