-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_addedScriptHashesCleanInterval
is not always cleared on redis.quit()
#1215
Labels
Comments
trentm
added a commit
to elastic/apm-agent-nodejs
that referenced
this issue
Oct 26, 2020
[email protected] includes a bug when using `redis.quit()` that can leave a setInterval uncleared. See redis/ioredis#1215. Fixes #1838
trentm
added a commit
to elastic/apm-agent-nodejs
that referenced
this issue
Oct 26, 2020
[email protected] includes a bug when using `redis.quit()` that can leave a setInterval uncleared. See redis/ioredis#1215. Fixes #1838
@ShogunPanda could you take a stab at fixing this? |
@AVVS Sure. Tomorrow (CET) I will take a look! |
AVVS
pushed a commit
that referenced
this issue
Oct 28, 2020
ioredis-robot
pushed a commit
that referenced
this issue
Oct 28, 2020
## [4.19.1](v4.19.0...v4.19.1) (2020-10-28) ### Bug Fixes * Make sure script caches interval is cleared. [[#1215](#1215)] ([d94f97d](d94f97d))
This was referenced Oct 28, 2020
1 task
1 task
This was referenced Feb 5, 2021
This was referenced Feb 16, 2021
1 task
This was referenced Mar 20, 2021
This was referenced Apr 19, 2021
janus-dev87
added a commit
to janus-dev87/ioredis-work
that referenced
this issue
Mar 1, 2024
## [4.19.1](redis/ioredis@v4.19.0...v4.19.1) (2020-10-28) ### Bug Fixes * Make sure script caches interval is cleared. [[#1215](redis/ioredis#1215)] ([d94f97d](redis/ioredis@d94f97d))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I believe 3b22f8f added a bug where the new
this._addedScriptHashesCleanInterval = setInterval(...)
(3b22f8f#diff-d3d9763dec19cf3dd977c437e0be3e6068b13161ee5a2b9b0bf225bddd2d83f8R188) isn't cleared viaclearInterval()
in all cases. This results in a dangling active handle that will hang a node process.Here is a repro:
or with ioredis debug output:
This does not happen if one uses
redis.disconnect()
instead ofredis.quit()
.When calling
redis.quit()
, the closeHandler (in event_handler.ts) is called withself.manuallyClosing == true
which does not call theclearInterval
added toRedis.prototype.disconnect()
.Some options I see (though I am not very familiar with ioredis, so I'm definitely happy to be overriden):
this._addedScriptHashesCleanInterval.unref()
(https://nodejs.org/api/timers.html#timers_timeout_unref) to theconnect
method. That'll prevent node from hanging, but will persist the setInterval after a program is presumably finished with the ioredis session.closeHandler
to explicitly callclearInterval
.this._addedScriptHashes
so that it doesn't require a setInterval to clear it. E.g. perhaps something like https://github.com/isaacs/node-lru-cache using itsmaxAge
option.The text was updated successfully, but these errors were encountered: