-
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
when keepAlive
parameter is set, the TCP keep-alive is enabled but the specified timeout is not applied
#1339
Comments
Thanks for the investigation. I think the cause of that issue is nodejs/node#31663 |
This was referenced Mar 26, 2022
marcbachmann
added a commit
that referenced
this issue
Mar 30, 2022
marcbachmann
added a commit
that referenced
this issue
Mar 31, 2022
luin
pushed a commit
that referenced
this issue
Mar 31, 2022
github-actions bot
pushed a commit
that referenced
this issue
Mar 31, 2022
## [5.0.3](v5.0.2...v5.0.3) (2022-03-31) ### Bug Fixes * add named exports to keep compatible with @types/ioredis ([#1552](#1552)) ([a89a900](a89a900)) * Fix failover detector with sentinel and tls streams ([ac00a00](ac00a00)) * handle NOPERM error for monitor ([93b873d](93b873d)), closes [#1498](#1498) * Hook up the keepAlive after a successful connect ([14f03a4](14f03a4)), closes [#1339](#1339)
🎉 This issue has been resolved in version 5.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
janus-dev87
added a commit
to janus-dev87/ioredis-work
that referenced
this issue
Mar 1, 2024
## [5.0.3](redis/ioredis@v5.0.2...v5.0.3) (2022-03-31) ### Bug Fixes * add named exports to keep compatible with @types/ioredis ([#1552](redis/ioredis#1552)) ([a89a900](redis/ioredis@a89a900)) * Fix failover detector with sentinel and tls streams ([ac00a00](redis/ioredis@ac00a00)) * handle NOPERM error for monitor ([93b873d](redis/ioredis@93b873d)), closes [#1498](redis/ioredis#1498) * Hook up the keepAlive after a successful connect ([14f03a4](redis/ioredis@14f03a4)), closes [#1339](redis/ioredis#1339)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ioredis version: 4.26.0
Node.js version: 14.16.1
OS: Ubuntu 18.04.3 LTS
Setting the
keepAlive
option enables the TCP keep-alive mechanism but does not apply the specified timeout.This can be reproduced with:
Running
knetstat
to inspect socket options shows the socket was created withTCP_KEEPIDLE=60
(which is the Node.js default):This is likely due to
socket.setKeepAlive()
being called after the connection has been established.To test this I have created a socket and tried calling
socket.setKeepAlive()
before and after callingsocket.connect()
.When
socket.setKeepAlive()
is called beforesocket.connect()
:knetstat
reportsTCP_KEEPIDLE=10
- keep-alive is enabled and the correct timeout is appliedWhen
socket.setKeepAlive()
is called aftersocket.connect()
:knetstat
reportsTCP_KEEPIDLE=60
- keep-alive is enabled but the Node.js default timeout is appliedThe text was updated successfully, but these errors were encountered: