Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent duplicate intervals being set. (#1244)
This issue has also been addressed by others in #1232 and #1226. Closes #1232. After calling `redis.quit` there are still many open `setInterval` handles that have not been cleared. These uncleared `setInternal` appear to be because everytime `connect` is called in the `reconnectTimeout` the `this._addedScriptHashesCleanInterval` is overridden but the old one still exists in the background. https://github.com/luin/ioredis/blob/v4.19.2/lib/cluster/index.ts#L311-L313 When you call `redis.quit` it only clears the current one retained by `this._addedScriptHashesCleanInterval`. ``` [WTF Node?] open handles: - File descriptors: (note: stdio always exists) - fd 1 (tty) (stdio) - fd 0 (tty) - fd 2 (tty) (stdio) - Intervals: - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 - (60000 ~ 60 s) (anonymous) @ /srv/app/node_modules/ioredis/built/redis/index.js:258 ```
- Loading branch information