diff --git a/lib/internal/cluster/primary.js b/lib/internal/cluster/primary.js index 945f440cd19797..e4a7f7d17f8484 100644 --- a/lib/internal/cluster/primary.js +++ b/lib/internal/cluster/primary.js @@ -45,6 +45,7 @@ let ids = 0; let initialized = false; // XXX(bnoordhuis) Fold cluster.schedulingPolicy into cluster.settings? +// XXX(alexfernandez) Folded cluster.schedulingPolicy into cluster.settings. let schedulingPolicy = process.env.NODE_CLUSTER_SCHED_POLICY; if (schedulingPolicy === 'rr') schedulingPolicy = SCHED_RR; @@ -65,6 +66,7 @@ cluster.setupPrimary = function(options) { exec: process.argv[1], execArgv: process.execArgv, silent: false, + schedulingPolicy: cluster.schedulingPolicy, ...cluster.settings, ...options, }; @@ -86,9 +88,10 @@ cluster.setupPrimary = function(options) { return process.nextTick(setupSettingsNT, settings); initialized = true; - schedulingPolicy = cluster.schedulingPolicy; // Freeze policy. + schedulingPolicy = settings.schedulingPolicy; // Freeze policy. assert(schedulingPolicy === SCHED_NONE || schedulingPolicy === SCHED_RR, - `Bad cluster.schedulingPolicy: ${schedulingPolicy}`); + `Bad settings.schedulingPolicy: ${schedulingPolicy}`); + cluster.schedulingPolicy = schedulingPolicy; // Show to the world. process.nextTick(setupSettingsNT, settings);