Skip to content

A DAP session whose connection closes without a terminated event is never noticed #1939

Closed

Description

@lagergren

Problem

DAPClient learns that a debug session ended only from its terminated event. When the connection of a session closes without one, nothing notices: connectToServer() keeps the Future of Launcher.startListening() only to cancel it in dispose(), and nothing waits for it to complete. This happens when the debug adapter crashed or was killed, or when the socket of a child session that vscode-js-debug started with startDebugging dropped. LSP4IJ then goes on treating the session as live.

With #1899 and #1900 this matters more:

Proposal

When the message loop of a session ends while the session is still live (it hasn't sent terminated, and it isn't being disposed), handle it as that session's terminated:

  • mark the session terminated;
  • forget its breakpoint answers;
  • stop the debug process if no session of the tree is still alive.

This needs a hook on the end of the message loop. For instance, a task on the client's threadPool could wait for the Future of startListening(), or a wrapper of the input stream could report its end.

It builds on #1899 and #1900, and came up in #1900's review and #1899's.

Activity

  1. added this to the 0.30.0 milestone on Nov 11, 2026
  2. added 2 commits that reference this issue on Nov 11, 2026
    650ecb7
    a042dbf
  3. added 2 commits that reference this issue on Nov 12, 2026
    9d4537a
    bde5e69
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions