Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

isolates require double exit call #2665

Closed
AndreasMadsen opened this issue Feb 1, 2012 · 3 comments
Closed

isolates require double exit call #2665

AndreasMadsen opened this issue Feb 1, 2012 · 3 comments

Comments

@AndreasMadsen
Copy link
Member

Testcase:

var fork = require('child_process').fork;

if (process.argv[2] === 'child') {
  setInterval(function () {
    console.log('alive ... ');
  }, 200);

  setTimeout(function () {
    console.log('exit child');
    process.exit(0);
  }, 500);
} else {
  var child = fork(process.argv[1], ['child'], {thread: true});
}

Output:

> out/Release/node child/test6
alive ... 
alive ... 
exit child
alive ... 
alive ... 
alive ... 
alive ... 
alive ... 
alive ... 
alive ... 
alive ... 
^C

The child should die at exit child but do not.
However if using two process.exit(0) it do work:

  setTimeout(function () {
    console.log('exit child');
    process.exit(0);
    process.exit(0);
  }, 500);
@AndreasMadsen
Copy link
Member Author

isolates is dead

@defunctzombie
Copy link

Why is isolates dead? Not feasible? No Point?

@AndreasMadsen
Copy link
Member Author

@bnoordhuis told me it created more problems than it solved. Very sad :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants