-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
- Node.js version: 17.5
- OS & version: Windows 11 x64
Actual behavior
Setting a job-specific worker.env field to SHARE_ENV causes nodejs to crash with a DOMException [DataCloneError]: Symbol(nodejs.worker_threads.SHARE_ENV) could not be cloned.
Expected behavior
No exception should be encountered, as the worker.env field should not be cloned into the worker thread, unlike worker.workerData.
The problematic piece of code can be found here at line 310, where the job object is directly added to workerData, which means that the symbol SHARE_ENV will be tried to be cloned into the worker thread, causing an exception.
Code to reproduce
jobs: [
{
name: 'test',
interval: '25d',
timeout: 0,
worker: {
env: SHARE_ENV
}
}
]Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Bree.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working