Skip to content

workspace trampoline directory fd collides with Node IPC channel #243

Description

@danny-avila

The selected-project execution path added by #222 can collide with the forked executor IPC descriptor.

spawnWithinWorkspace always places the held directory on fd 3 and only strips NODE_OPTIONS and NODE_PATH. The forked Node executor is launched with stdio: ["ignore", "ignore", "ignore", "ipc"], making NODE_CHANNEL_FD equal to 3. The trampoline Node process can therefore treat the directory fd as its IPC channel before fchdir(3), causing startup failure or an incorrect working directory.

Found while syncing #222 into ClickHouse/ai: https://github.com/ClickHouse/ai/pull/3926#discussion_r4058967763

Suggested direction: reserve a non-conflicting descriptor or explicitly remove/reassign inherited Node IPC state, with an integration test through the actual forked executor.

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