-
Notifications
You must be signed in to change notification settings - Fork 13
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
Errors not being detected properly by hiredis
on Linux
#45
Comments
Tried to reproduce it in docker, but all fine...
output
bug.js
Do I miss something or it is related to some special version of Linux or Docker or Node maybe? |
Right in Docker is working I don't know why I said that in the first place. The problem appears in Ubuntu 20.04 (maybe in other versions and distributions but I don't have the means to test it). It is definitely something related to the C++ library, but that's how far my understanding of the problem goes. |
I'll check if there is a more fresh version of |
I spent a week going through
Just for information, my OS is Ubuntu 20.04. |
I see, will try to replicate it in VM when will have a time, thanks for details |
This issue is related to #22 and aiming to provide more information about the real problem.
As the author states in his PR, there is a reconnect issue that appears, but just in Linux (works in Mac, not tested on Windows).
Scenario
Create test app:
test.js:
run app
This should trigger the reconnect behaviour and try to reconnect to redis 25 times. But it doesn't.
Why is it though?
Debugging
Setting the
ENABLELOG
property to 1 in thebinding-gyp
file:redis-fast-driver/binding.gyp
Line 15 in 2429fa3
status=1 Connection Refused
) that should be captured in theConnectCallback
is not being capturedredis-fast-driver/src/redis-fast-driver.cc
Lines 61 to 79 in 2429fa3
How can we prove that? Testing
hiredis
:Add some extra logging if needed.
This execution proved that the same error (
Connection Refused
on loopback interface) IS being captured by theconnectCallback
. So it shouldn't be a problem ofhiredis
either.Another important thing is that other errors are being correctly captured and thrown, and the reconnect behavior works as expected, for example, using an invalid
host
such as:This will throw a
status=2 Temporarily failure in name resolution
. Although not in the connect callback but immediately after theredisAsyncConnect
call:redis-fast-driver/src/redis-fast-driver.cc
Lines 134 to 149 in 2429fa3
Observations
hiredis
works as expected and captures theConnection Refused
error in theconnectionCallback
redis-fast-driver
does not capture theConnection Refused
error in theConnectCallback
ConnectCallback
are properly thrown and the reconnect behavior works properlyor DockerWe are out of ideas on which could be the root problem of this, and why is OS dependant. The last thing that seems to be the problem is the compilation made by
node-gyp
ofhiredis
.I'm not familiar with
node-gyp
so I couldn't go further into it but I saw thishiredis.gyp
file with some conditions forMacOS
andSolaris
:redis-fast-driver/deps/hiredis.gyp
Lines 16 to 24 in 2429fa3
Hope you can help with this problem!
Thanks!
The text was updated successfully, but these errors were encountered: