No way to determine if underlying connection has been killed
Author: phawxbyCreated Sep 2, 2022Updated Sep 11, 2026
Labelsstale
In the event that client.quit(); is called I would expected client.status to update to something like disconnecting or closing and then to close once complete. That does not happen.
console.log(this._redisClient?.status);
await this._redisClient?.quit();
console.log(this._redisClient?.status);
await this._redisClient?.quit();
console.log(this._redisClient?.status);
OUTPUT
ready
ready
[ioredis] Unhandled error event: Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:164:15)
at writeGeneric (node:internal/stream_base_commons:155:3)
The same applies when calling await this._redisClient?.quit(); too.
Incidentally it would be good to get some tsdocs on the statuses so it's obvious what they mean, for example what's the difference between end and close
https://github.com/luin/ioredis/blob/main/lib/Redis.ts#L37-L44
Source: redis/ioredis