Skip to content

Node 24.20+ concurrent localhost endpoint probes cause attach failures #2416

Closed

Description

@deepak1556
  1. Open an empty folder and create .vscode/launch.json:

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Attach over localhost",
          "type": "node",
          "request": "attach",
          "address": "localhost",
          "port": 9229,
          "timeout": 30000,
          "trace": true
        }
      ]
    }
  2. In terminal, start an inspector that listens only on IPv4:

    node --inspect-brk=127.0.0.1:9229 -e 'setInterval(() => {}, 1 << 30)'
  3. Run Attach over localhost in latest vscode insiders. The attach fails.

  4. Change address to 127.0.0.1 and run it again. The attach succeeds.

Activity

  1. added
    bug
    on Sep 18, 2026
  2. deepak1556 commented on Sep 18, 2026

    @deepak1556
    CollaboratorAuthor

    getWSEndpoint requests /json/version and /json/list concurrently. Each endpoint goes through fetchJsonWithLocalhostFallback. For localhost, it explicitly constructs one URL for 127.0.0.1 and one for [::1].

    When IPv4 wins, the finally block calls cts.cancel(). In BasicResourceProvider.requestHttp, that cancellation invokes AbortController.abort() for every unfinished request using the derived token. The IPv6 connection has already failed with ECONNREFUSED, got treats that as retryable, computes a backoff, and schedules another request.

    The current got request has already called the underlying ClientRequest.end(callback). Before Node 24.20, that callback was attached to the successful finish event. An aborted request did not finish, so the callback was not invoked with the abort error. Node.js 24.20 makes the cancellation a new terminal path. More details in sindresorhus/got#2469

  3. added a commit that references this issue on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions