This repository provides a minimal setup to reproduce a Node.js issue involving the Redis package under specific conditions.
In Node.js versions >= 20.x, forking child processes that import the Redis package while the application operates under the FIFO CPU scheduling policy causes both parent and child processes to hang indefinitely, consuming 100% CPU. Note that the Redis package does not need to be actively used, just imported.
The issue does not occur if:
- The Redis package is not imported.
- The application is running under a different CPU scheduling policy.
- The application is running on Node.js versions prior to 20.x.
- Node.js 20.x or later
- Redis package: 3.1.2 and 4.7.0
- Ubuntu 20.04 or 22.04
- Redis server: 6.0.16 malloc=jemalloc-5.2.1 bits=64
- Ensure Node.js version 20.x or later is installed on your system.
- Clone this repository into the
/tmp
directory: - Copy the systemd unit file and reload systemd:
sudo cp /tmp/cp-fork-sample/cp-fork-sample.service /etc/systemd/system/ sudo systemctl daemon-reload
- Note: Update the
ExecStart
path in the unit file to point to your Node.js binary.
- Note: Update the
- Start the service:
sudo systemctl start cp-fork-sample