Skip to content

Implement Windows Job Object creation and atomic assignment #320

Done

Description

@morluto

Create a dedicated unnamed Job Object with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, breakaway disabled, and atomic process assignment (preferably PROC_THREAD_ATTRIBUTE_JOB_LIST). Expose a typed ownership observation.

Acceptance:

  • Native Node-API implementation creates and assigns the Job before process execution.
  • Reports handle inheritance, kill-on-close, breakaway, and nested-Job constraints.
  • Malformed or unsupported reports fail closed.

Part of #288.

Activity

  1. added
    enhancement
    P1: high
    on Jul 20, 2026
  2. added
    area: runtime
    on Oct 14, 2026
  3. morluto commented on Nov 24, 2026

    @morluto
    OwnerAuthor

    Closing as implemented: native/windows/src/process.cc (createJob, spawnProcess) creates an unnamed Job Object with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, verifies breakaway is disabled via QueryInformationJobObject, atomically assigns the suspended process via PROC_THREAD_ATTRIBUTE_JOB_LIST (UpdateProcThreadAttribute), checks IsProcessInJob before ResumeThread, and returns jobAssigned: true and killOnOwnerClose: true. src/windows/WindowsOwnedProcess.ts validates this with launchSchema and fails closed via WindowsNativeSpawnControlError on malformed or unsupported responses (landed in PR #699 / 26881da76a).

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

    P1: higharea: runtimeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions