Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CPU at 100% when forking processes that import node-redis #2868

Open
prlanzarin opened this issue Nov 19, 2024 · 0 comments
Open

CPU at 100% when forking processes that import node-redis #2868

prlanzarin opened this issue Nov 19, 2024 · 0 comments
Labels

Comments

@prlanzarin
Copy link

Description

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.

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.

This is reproducible with both redis@4.7.0 and redis@3.1.2.

The following repo has a sample reproducible application: https://github.com/prlanzarin/cp-fork-sample
See the README for instructions.


PS.: I quickly poked at redis@3.1.2 and ended up figuring out that commenting the following prototype assignment got the application to stop misbehaving:

Multi.prototype[command.toUpperCase()] = Multi.prototype[command] = function () {

I've not looked into the equivalent breakpoint in 4.7.0.

PS2.: I reckon this may be a Node.js issue specifically, but I'm yet unable to reproduce this without any external dependencies - so I'm opening this issue here first.

Node.js Version

v22.11.0 (or 20.x)

Redis Server Version

6.0.16 malloc=jemalloc-5.2.1 bits=64

Node Redis Version

redis@4.7.0 (or redis@3.1.2)

Platform

Ubuntu 22.04 (or 20.04)

Logs

No response

@prlanzarin prlanzarin added the Bug label Nov 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant