Redis client does not quit when `isolationPoolOptions` is provided
ivan-kleshnin opened this issue · 1 comments
Description
I'm using Redis-Node to implement CLI scripts. For CLI it's crucial that process(es) end normally and don't hang and/or accumulate in background. I'm using a lot of database clients and Redis-Node is the only one that keeps the process hanging when the pooling is enabled.
I'm using Bun instead of Node.js, so the issue very well might be on Bun's side. Hovewer, I suspect that this bug might appear as a side-effect of another issue. So it would be great to get a confirmation from someone experienced.
Normal case
import {createClient} from "redis"
const client = createClient({
url: process.env.REDIS_ORIGIN,
username: process.env.REDIS_LOGIN,
password: process.env.REDIS_PASSWORD,
// If no`isolationPoolOptions` – everything's ok
})
await client.connect()
await client.ping()
// ...
await client.quit()Hangs the process
import {createClient} from "redis"
const client = createClient({
url: process.env.REDIS_ORIGIN,
username: process.env.REDIS_LOGIN,
password: process.env.REDIS_PASSWORD,
isolationPoolOptions: { // !!! added this setting !!!
min: 1, // exact numbers do not matter
max: 2,
}
})
await client.connect()
await client.ping()
// ...
await client.quit() // Prevents the process from termination (in Bun)Node.js Version
Works with NodeJS (22.4.0), hangs with Bun (1.1.25)
Redis Server Version
7.2.5
Node Redis Version
4.7.0
Platform
MacOS
Logs
No response
Fixed in Bun 1.1.25 👏 Was related to TCP connection being improperly released:
https://bun.sh/blog/bun-v1.1.25#fixed-connection-hangs-with-node-net-after-destroy