Skip to content
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

Redis connection not getting closed when pingInterval is set as part of RedissocketOptions #2608

Open
venki1092 opened this issue Sep 6, 2023 · 4 comments
Labels

Comments

@venki1092
Copy link

Description

Hi ,

I create my RedisClient using below params

const client = createClient({ url: url, socket: { reconnectStrategy: reconnectInterval }, pingInterval: pingInterval });

When I try to close this handle using quit or disconnect it doesnt close. I see this following open handles

`tcp stream {
fd: 14,
readable: true,
writable: true,
address: {},
serverAddr: null
}

tcp stream {
fd: 18,
readable: true,
writable: true,
address: {},
serverAddr: null
}

tcp stream {
fd: 19,
readable: true,
writable: true,
address: {},
serverAddr: null
}`

But if I remove pingInterval: pingInterval parameter during client creation handle gets closed properly on client.disconnect. Discovered this behavior while writing unit tests in Jest and had to close the handle as part of it. Please help me with this.

Node.js Version

v20.4.0

Redis Server Version

6.2.13

Node Redis Version

4.6.5

Platform

Linux

Logs

No response

@venki1092 venki1092 added the Bug label Sep 6, 2023
@leibale
Copy link
Collaborator

leibale commented Sep 6, 2023

Duplicate of #2524? try to update to the latest version, which contains this fix..

@venki1092
Copy link
Author

Thank you. Will check this out.

@rizowski
Copy link

This still seems to be an issue for me.

Node 18.17
Redis: 4.6.12

Doesn't matter if I have ping interval or not, the socket persists after a disconnect or quit. The client thinks that it's closed but the process remains running.

@Senthilmj
Copy link

Senthilmj commented Mar 21, 2024

This still seems to be an issue for me.

Node 18.17 Redis: 4.6.12

Doesn't matter if I have ping interval or not, the socket persists after a disconnect or quit. The client thinks that it's closed but the process remains running.

how did u fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants