Skip to content

Destroy the helper process in NodeJsManager.executeCommand - #497

Merged
Sheng Chen (jdneo) merged 1 commit into
microsoft:mainfrom
vogellacompany:nodejs-command-process-cleanup
Oct 20, 2026
Merged

Sheng Chen (jdneo) merged 1 commit into
microsoft:mainfrom
vogellacompany:nodejs-command-process-cleanup

Conversation

@vogella

@vogella Lars Vogel (vogella) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

NodeJsManager.executeCommand, used to locate Node.js through a login shell and to run node -v on the result, only closed the stdout reader of the process it started. The process itself was never destroyed and its stderr pipe was never drained, so each call left a process and its file handles behind, and a login shell writing a lot to stderr could block. The process is now started with stderr discarded and destroyed once the first output line, the only one the callers use, has been read.

executeCommand only closed the stdout reader of the process it started, so the processes used to locate Node.js through a login shell and to run node -v were never destroyed and their stderr pipe was never drained. The process is now started with stderr discarded and destroyed after the first output line has been read.

Assisted-by: multiple AI agents and layers of automated tooling 🤖

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The localized cleanup preserves caller behavior and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Improves cleanup of helper processes used to locate and validate Node.js.

Changes:

  • Discards stderr to prevent pipe-buffer blocking.
  • Destroys the process in finally, preserving first-line output handling.
File Description
com.microsoft.copilot.eclipse.core/​src/​com/​microsoft/​copilot/​eclipse/​core/​lsp/​NodeJsManager.java Adds stderr redirection and helper-process cleanup.

Review effort: Balanced

@jdneo Sheng Chen (jdneo) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@jdneo
Sheng Chen (jdneo) merged commit 4dedbeb into microsoft:main Oct 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants