[BUG] Cluster worker message listener registration failure with ESM files extension
Maintainer thường phản hồi trong vòng 1 ngày
@jerome-benoit đang làm issue này rồi.
Từ ngày 27/6/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
Messages sent from main thread with worker.send() are not handled worker side by the message handler registered with
cluster.worker.on('message', (msg) => ...) if implemented with ESM.
Since the primary usage of cluster pool is stateless network services, not being able to submit a task to it does not hinder that usage with ESM files extension.
The investigation needs the ensure the issue is not related to a node.js version.
Tests shall be added to ensure the internal IPC used on each pool type works by using ESM files extension.
Steps to reproduce the behavior
Submit a task to a cluster pool by using ESM files extension.
Expected behavior
Cluster pool tasks execution shall work by using ESM files extension.
Info
| Tool | Version |
|---|---|
| Poolifier | v2.6.x |
| Node | v20.3.1 |
| OS | win,linux,mac |
Additional context
Code triggering the issue to put in benchmarks/internal and run from the repository root after pnpm build: node benchmarks/internal/{filename}.mjs
import { WorkerChoiceStrategies } from '../../lib/index.mjs'
import {
PoolTypes,
WorkerFunctions,
WorkerTypes
} from '../benchmarks-types.mjs'
import { buildPool, runTest } from '../benchmarks-utils.mjs'
const poolSize = 30
const taskExecutions = 1
const workerData = {
function: WorkerFunctions.jsonIntegerSerialization,
taskSize: 1000
}
const workerChoiceStrategyRoundRobinPoolOption = {
workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN
}
// const fixedThreadPoolRoundRobin = buildPool(
// WorkerTypes.thread,
// PoolTypes.fixed,
// poolSize,
// workerChoiceStrategyRoundRobinPoolOption
// )
const fixedClusterPoolRoundRobin = buildPool(
WorkerTypes.cluster,
PoolTypes.fixed,
poolSize,
workerChoiceStrategyRoundRobinPoolOption
)
// await runTest(fixedThreadPoolRoundRobin, {
// taskExecutions,
// workerData
// })
await runTest(fixedClusterPoolRoundRobin, {
taskExecutions,
workerData
})
- Ngôn ngữ chính
- JavaScript
- Star
- 454
- Fork
- 17
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của poolifier/poolifier
-
Dependency DashboardĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của poolifier/poolifier
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
capricorn86/happy-dom#2485 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:space-accuracy good first issue track:data
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Sara-Managed-Projects/space-radar#904 ·
Maintainer thường phản hồi trong vòng 1 ngày