Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
problem context
0. a client have two database index, so need to re_select()
the problem is here.
cpp_redis/sources/core/client.cpp
Line 330 in d1fc9c7
cpp_redis/sources/core/client.cpp
Lines 433 to 482 in d1fc9c7
cpp_redis/sources/core/client.cpp
Lines 1949 to 1958 in d1fc9c7
cpp_redis/sources/core/client.cpp
Lines 194 to 198 in d1fc9c7
m_commandsis not empty, so ...cpp_redis/sources/core/client.cpp
Lines 308 to 327 in d1fc9c7
m_commands, this variable will still have the previously select(call byunprotected_select()) commandeven if
commands.pop(), this variablem_commandspushed again (byunprotected_send)also,
m_bufferhave duplicate data.."SELECT" cmd sended twice, so callback data can be weired.. (even if reconnecting successful)🙀
but reply is not a current callback, the callback is previous old data when reconnecting (by re_select functions called)
solving problem
I suggest this code:
original code:
cpp_redis/sources/core/client.cpp
Lines 478 to 481 in d1fc9c7