Sometimes (not always) I am getting
“Unable to Connect: sPort: 0”
error when trying to get value from Redis when using ServiceStack.Redis. Does anyone know what that might mean? I am using PooledRedisClientManager to get the client.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe you can fix this by increasing the pool’s
ConnectTimeout. I had it set very low (10ms), so when the pool was created, some of the clients were unable to connect in that short period. If the pool returned one of these clients, it would throw this error (the “0” port is because it’s not connected — it doesn’t know what port it’s not connected to). After a delay, all of the clients are able to connect.I increased my connect timeout to 500ms, and the problem went away — the clients all connect, though some of them block for a couple hundred milliseconds. But that’s much better than an error.