Skip to content

Forked child process not detaching on windows #5146

@filmerjarred

Description

@filmerjarred

As far as I can tell the expected default behavior of a child process created with child_process.fork, is to be able to run independently of the process that spawned it once the parent dies.

//parent.js
var child_process = require("child_process");

var p = child_process.fork("child.js")
p.disconnect();
p.unref();

process.exit()
//child.js
setTimeout(function(){
    console.log(1);
}, 1000000);

So if parents.js is executed, child.js should remain as an orphaned process after the parent exits. This works on Linux, but not on Windows.

Tested on Ubuntu 14.04.3 LTS and Windows 8.1
Using Node v5.5.0 and v0.10.25 (both tested on each platform)

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions