Repository navigation
Conversation
Share startup and DAP handshake handling between the Node debug delegates, so that cancellation, adapter exit and timeouts end the launch with an error which includes the adapter output. Assisted-by: multiple AI agents and layers of automated tooling 🤖
| throw new CoreException(Status.error("Debug adapter not found.", ex)); //$NON-NLS-1$ | ||
| } | ||
| int port = DebugAdapter.findFreePort(); | ||
| DebugAdapter adapter = DebugAdapter.start(launch, new String[] { runtimeExecutable.getAbsolutePath(), |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Immediate handshake failures can omit captured adapter diagnostics and let unchecked exceptions escape instead of producing a diagnostic CoreException.
1 open issue
What changed in this PR
Centralizes Node debug adapter lifecycle handling for launch and attach, adding bounded startup handling, failure diagnostics, and process cleanup.
Changes:
- Introduces a shared
DebugAdapterfor startup monitoring, handshake timeouts, cancellation, and cleanup. - Refactors both delegates to use it, with attach now inheriting Eclipse’s environment and using IPv4 loopback.
- Adds tests for cancellation, adapter exits, and handshake timeouts.
| File | Description |
|---|---|
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/VSCodeJSDebugDelegate.java | Replaces duplicated launch lifecycle code with the shared adapter. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/NodeAttachDebugDelegate.java | Adopts shared handling, inherited environment, and IPv4 loopback. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/DebugAdapter.java | Implements adapter monitoring, diagnostics, timeouts, and cleanup. |
| org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests/TestDebug.java | Adds cancellation and adapter failure tests. |
Review effort: Balanced
| if (ex instanceof OperationCanceledException) { | ||
| throw canceled(); | ||
| } | ||
| throw ex; |
Contributor
|
I'm concerned about large last minute changes that will end up in the release without having even been tested by any user. Is now really a good time for such changes I wonder? Also this PR has a copilot review while a new PR is being queued up: Maybe we could finish one after another. And we do need to find closure very, very soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

A Node debug adapter which crashed, never answered or was canceled during launch could leave the launch hanging, running on silently or reporting nothing useful. Launch and attach now share this handling in a new
DebugAdapterclass: these cases end the launch with an error that includes the adapter's stdout and stderr, and the adapter process is stopped. This also removes the duplicated startup, watchdog and cleanup code from the two delegates, and attach now passes Eclipse's environment to the adapter like launch already does.