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

Reconnecting blocks whole app. #1014

Closed
aviatrix opened this issue Dec 1, 2019 · 4 comments
Closed

Reconnecting blocks whole app. #1014

aviatrix opened this issue Dec 1, 2019 · 4 comments

Comments

@aviatrix
Copy link

aviatrix commented Dec 1, 2019

I'm testing the auto reconnect features of ioredis, and i've noticed that everytime ioredis looses connection to the redis server (non cluster, non sentinel), it blocks everything for 1 minute per ioredis request.
I've managed to cut that down to 1 second by tweaking maxRetriesPerRequest = 1 and retryStrategy to 1s minimum, but when my http request do 10-20-100 redis requests (unable to bundle those into mget unfortunately) this slows down everything?

Can i make ioredis reconnect in the background naively, without having to implement custom logic?

@stale
Copy link

stale bot commented Dec 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot added the wontfix label Dec 31, 2019
@aviatrix
Copy link
Author

aviatrix commented Jan 4, 2020

Anyone has any ideas/clues how to prevent blocking?

@stale stale bot removed the wontfix label Jan 4, 2020
@luin
Copy link
Collaborator

luin commented Jan 4, 2020

Sorry for the late response.

You can set maxRetriesPerRequest to 0 so that commands will be rejected when the connection is lost, but the connection will keep reconnecting.

@stale
Copy link

stale bot commented Feb 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot added the wontfix label Feb 3, 2020
@stale stale bot closed this as completed Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant