Closed ivantishchenko closed 4 weeks ago
After digging in the code I realized that REDIS_SOCKET_TIMEOUT and REDIS_CONNECTION_TIMEOUT were both set to 500ms. Increasing these timeouts solved the issue.
sw::redis::ConnectionOptions opt;
opt.host = host;
opt.port = port;
opt.socket_timeout = REDIS_SOCKET_TIMEOUT;
opt.connect_timeout = REDIS_CONNECTION_TIMEOUT;
@ivantishchenko Resource temporarily unavailable means request timeout. You can increase your socket_timeout or set it to 0ms to make the connection blocking for response without timeout.
Describe the bug I have one connection to redis
std::shared_ptr<sw::redis::Redis> _redis
and trying to reuse it from multiple threads.For this I use a thread pool with 16 threads.
To Reproduce Call from at least 16 threads on ~100 different keys. In 1-5 cases you will receive
Failed to get reply: Resource temporarily unavailable.
Expected behavior All keys can be fetched without an exception.
Environment: