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

cluster: exception in master doesn't kill workers #2047

Closed
@bnoordhuis

Description

To reproduce:

var assert = require('assert');
var cluster = require('cluster');

if (cluster.isMaster) {
  cluster.fork();
  throw new Error('kill master'); // should kill the worker too
} else {
  setTimeout(function() {
    assert(false, 'worker should have been killed');
  }, 2500);
}

The workers array is empty in the uncaughtException listener that startMaster() installs so the listener doesn't actually kill anything.

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions