Open hmartiro opened 9 years ago
Is this bug going to be fixed soon? It stops me from using this library in my project.
Hi there. Can you help and post the simplest program you can make that demonstrates this behavior?
Here it is:
#include <redox.hpp>
#include <iostream>
#include <thread>
#include <chrono>
int main()
{
redox::Redox connection;
if(!connection.connect("localhost")) {
std::cout << "Cannot connect!\n";
exit(1);
}
while(true) {
redox::Command<std::string>& c = connection.commandSync<std::string>({"BLPOP", "key", "0"});
// If the redis-server stops, command fails
if (!c.ok()) {
std::cout << "Command failed!\n";
// It is also impossible to reconnect here (SIGSEGV)
// If I want to reconnect I have to create new Redox object
// while(!connection.connect("localhost")) {
// std::this_thread::sleep_for(std::chrono::seconds(5));
// }
}
else {
std::cout << "Reply: " << c.reply() << std::endl;
}
// When I try to free failed command, I get SIGSEGV, when I don't
// free failed command, I get warning from Redox to stdout
// "Not all commands were freed"
c.free();
std::cout << "Done\n";
}
}
Thank you. I will try to find time to investigate this. I have frustrations with disconnect interactions with hiredis.
Facing the same issue. Is there a workaround ?
Hi all Please upgrade hiredis and libev to latest versions. Once these are upgraded, I was not able to reproduce this issue. (working with redis 3.2.6 on fedora)
Please let me know if you are still facing problems.
Can get segfaults if the server goes down while running commands. Get back to the previous behavior, where the disconnect callback is invoked.