Hi.
I need to know a way for hiredis clients to detect server down during command session for clients' safety.
I inserted sleep(30) in the middle of command session of hiredis/example.c. While the client is sleeping,
I stopped the redis-server to which the client has connection. After the client woke up, it crashes. Here's
output to stdout.
$ ./hiredis-example
PING: PONG
SET: OK
SET (binary API): OK
GET foo: hello world
INCR counter: 5
INCR counter: 6
Segmentation fault (core dumped)
Segmentation fault cannot be acceptable for a server process. It may be better to interleave connect and
disconnect for every redis command session but this is not perfect.
Let me know a programming pattern or such example of a redis client (by hiredis) to keep working (not to die)
by redis-server down (or error) during client's command session.
Thanks in advance.