commandTimeout option triggers Command timed out error after connecting to redis server
Hello, commandTimeout option set to 20ms throws out Error: Command timed out in my case.
I have set event listeners set for connection events connect, ready (with enableReadyCheck=true), disconnect
- Error is thrown after the
connectevent, -
disconnectevent is triggered after above error is thrown - ioredis retries to connect,
connectevent is triggered - Above 3 steps keep looping
I want the redis commands to timeout after 20ms hence I'm using commandTimeout
Can you please explain why command timeout error is triggered after connecting to the server if the timeout value is around 20ms? or am I missing something?
20ms is quite low. are you sure about that? the ready check command probably times out as the initial connection and sending the command takes longer.
Let's say the application has sent a GET command but there is a connection issue, I don't want the application to wait more than 20ms because most of my GET call latencies are under 5ms
But this command timeout is being applied while getting the connection itself and timing out (with ready check disabled).
Is there no way to exclude the command timeout while getting connection? or if there is a way to pass options as arguments for each command