Skip to content

Non-zero minimum isolation connection pool size causes infinite function recursion (instant crash) #1674

@EdNutting

Description

@EdNutting

Hi,

When calling createClient, specifying a positive number for the isolationPoolOptions.min value causes an infinite recursion through the RedisClient constructor. It seems the initial create client calls the constructor, which checks the isolation pool options, which sees there are (say) 3 connections required, so it calls duplicate to create them. duplicate passes the same isolation options to the new RedisClient, which repeats the same check. Thus, infinite recursion.

I suggest that nested RedisClients created via duplicate should be given empty/undefined isolationPoolOptions. I think it is also surprising/unintuitive that calling duplicate on the top-level redis client would result in an entire new pool being created (i.e. doubling the number of connections) rather than just creating a single new (separate) connection.

Environment:

  • Node.js Version: 16.4.2
  • Redis Server Version: N/A
  • Node Redis Version: 4.0.0-rc.2
  • Platform: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions