node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

isolationPoolOptions have terrible defaults

Open VivaLaPanda opened this issue 11 months ago • 1 comments

Description

Currently node-redis uses the same default options as GenericPool for isolationPoolOptions. Not only are the params poorly documented, the default parameters are not something you'd almost ever want. The default max pool size is 1, which means setting isolated: true has no effect.

The package should either set new defaults, or warn in the documentation to always configure these if using isolated: true.

Node.js Version

No response

Redis Server Version

No response

Node Redis Version

No response

Platform

No response

Logs

No response

VivaLaPanda avatar Mar 15 '24 15:03 VivaLaPanda

Wow. And I was wondering why neither syntax for isolated works properly... There's almost a dozen of issues related to this topic!

Maybe you also could help me to learn why the following quits fine:

let client = createClient({
  url: `${origin}/${database}`,
  username: login,
  password,
})

await client.connect()
await client.quit()

but the following stucks:

let client = createClient({
  url: `${origin}/${database}`,
  username: login,
  password,
  isolationPoolOptions: {
    min: 10,
    max: 20,
  }
})

await client.connect()
await client.quit() // does not exit, keeps the whole Node/Bun process 

🙏

ivan-kleshnin avatar Aug 16 '24 09:08 ivan-kleshnin