Skip to content

Child processes carry no instance identifier in argv #9179

Description

@craxal

Problem

Provider and job-handler child processes carry nothing on their command line that identifies which app instance spawned them. NodeProcessProxy forks with env: { ...process.env }, so children inherit the full environment, but fork(this._modulePath, this._processArgs, ...) passes no instance-identifying token in argv.

That matters because argv is the only channel visible from outside the process. Anything that needs to attribute a stray helper to an instance -- a cleanup pass, a diagnostic, an operator looking at ps after a crash -- has no way to do it. Orphaned helpers hold ports, locks, and memory in production, not just in test runs.

Constraint

The token must be opaque. It must not be the user data directory path or anything derived from it: command lines are world-readable via ps, so putting that path in argv would expose the user's home directory to every process on the machine.

Evidence

  • src/Standalone/app/main/NodeChildProcess/NodeProcessProxy.ts:38-47 -- builds envVars from process.env and forks with this._processArgs

Context

Surfaced during E2E harness work, where the test teardown has to snapshot the process tree before quitting precisely because descendants cannot be identified afterward. Fixing this would let that snapshot be replaced with a direct match. The change lands in the provider host spawn path shared by every extension, so it was left out of the harness PR.

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions