-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cluster: add scheduling policy to
cluster.settings
- Loading branch information
1 parent
c4d0229
commit 9f797a2
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/known_issues/test-cluster-import-scheduling-policy.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Refs: https://github.com/nodejs/node/issues/49240 | ||
// When importing cluster in ESM, cluster.schedulingPolicy cannot be set; | ||
// and the env variable doesn't work since imports are hoisted to the top. | ||
// Therefore the scheduling policy is still cluster.SCHED_RR. | ||
import '../common/index.mjs'; | ||
import assert from 'node:assert'; | ||
import * as cluster from 'cluster'; | ||
|
||
|
||
assert.strictEqual(cluster.schedulingPolicy, cluster.SCHED_RR); | ||
cluster.setupPrimary({ schedulingPolicy: cluster.SCHED_NONE }); | ||
const settings = cluster.getSettings(); | ||
assert.strictEqual(settings.schedulingPolicy, cluster.SCHED_RR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters