-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Open
Labels
clusterIssues and PRs related to the cluster subsystem.Issues and PRs related to the cluster subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.
Description
Version
v20.3.1
Platform
All supported platform
Subsystem
No response
What steps will reproduce the bug?
After a migration of code to ESM by using .mjs file extensions, the poolifier project has encountered issues at running internal benchmarks code.
Test case:
- main.mjs:
import cluster from 'cluster'
cluster.setupPrimary({ exec: './worker.mjs' })
const worker = cluster.fork()
worker.on('message', message => {
console.info('message received from worker:', message)
})
worker.on('online', () => {
console.info('worker is online')
})
worker.on('error', (error) => {
console.info('worker error', error)
})
worker.on('disconnect', () => {
console.info('worker disconnected')
})
worker.on('exit', () => {
console.info('worker exited')
})
worker.send('hello')- worker.mjs:
import cluster from 'cluster'
cluster.worker.on('message', message => {
console.info('echo message received from main:', message)
cluster.worker.send(message)
})node main.mjs is frozen.
How often does it reproduce? Is there a required condition?
100% reproducible
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
Callback is never called if a message is sent from the primary.
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
clusterIssues and PRs related to the cluster subsystem.Issues and PRs related to the cluster subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.