-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add possibility to configure socket timeout #1358
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
Comments
If you create your own net instance with RedisClient's second argument you can put anything you'd like in as far as options. Be warned that it's not an official feature, and it may go away. |
Oops hit delete on my comment. I'm having this exact issue. It seems like This looks like where it is https://github.com/NodeRedis/node_redis/blob/04a09aa2ffcbae9f380b61a4afe15badfe5be5ef/index.js#L255 Correct me if I'm wrong about any of this please, I'm trying to tackle this issue as well. |
This really needs to be addressed ASAP. Right now, if your Redis server ever becomes unavailable for more than a few seconds, the library becomes unsafe/unusable. If you set the If you set it to a high value (or leave it as the default), it takes 3+ mins to recover and reconnect - no matter what other options you use. This has been brought up before (#652), but the PR was closed, seemingly without understanding that the implemented solution did not resolve the issue. At present, other than using the undocumented second argument, there is simply no way to use this library safely. |
Alternatively, as it does seem fairly unlikely that this package will ever be updated again, this library is mostly compatible and has a much more sane approach to timeouts/retrying/etc.: https://github.com/luin/ioredis Looks like a new major version of that lib (v4) is currently in beta, so might be worth waiting until it is released. |
@jordie23 and @billinghamj I would entertain a PR that resolves the issue. |
This seems to be related to #1430 |
Hi I wrote a comment in: On how we can recreate the redis client from the app level once the client has ended (eg from connect_timeout), both in a blocking and non-blocking way. But yes, ideally, it should be handled by the underlying library. |
Thanks for wanting to report an issue you've found in node_redis. Please delete
this text and fill in the template below. Please note that the issue tracker is only
for bug reports or feature requests. If you have a question, please ask that on gitter.
If unsure about something, just do as best as you're able.
Note that it will be much easier to fix the issue if a test case that reproduces
the problem is provided. It is of course not always possible to reduce your code
to a small test case, but it's highly appreciated to have as much data as possible.
Thank you!
I would like to configure redis client to wait only a given timeout.
The deprecated param connect_timeout seems to not work as expected.
Is there any way to configure socket timeout in node-redis?
The text was updated successfully, but these errors were encountered: