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

disconnect() after connect() does not stop client reconnection attempt. #2621

Open
hkroger opened this issue Sep 26, 2023 · 2 comments
Open
Labels

Comments

@hkroger
Copy link

hkroger commented Sep 26, 2023

Description

Related to #2010.

  1. If I try client connect but it fails to connect to any server and throws error events with:
    Error: connect ECONNREFUSED ::1:6379.
  2. redis.disconnect() does not stop those reconnection attempts.

Node.js Version

18.18.0

Redis Server Version

7.2

Node Redis Version

4.6.10

Platform

MacOS

Logs

No response

@hkroger hkroger added the Bug label Sep 26, 2023
@Iyadchafroud
Copy link

it try to reconnect maybe because you use retrystrategy as option :
new Redis({

retryStrategy: (times) => {
const maxDelay = 5000; // Maximum delay between reconnection attempts (in milliseconds)
const delay = Math.min(times * 1000, maxDelay);
console.error(Redis connection lost. Reconnecting in ${delay}ms...);
return delay;
}});`

@DjellalAbdou
Copy link

can't reproduce it, can you pls share an example ? i thought that the fix was merged here by @leibale

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

3 participants