openresty / lua-resty-redis

Lua redis client driver for the ngx_lua based on the cosocket API
1.91k stars 448 forks source link

Add keepalive for redis client to make the connections reliable #263

Open NomadXD opened 1 year ago

NomadXD commented 1 year ago

In a case of a sudden connection loss Redis clients are not able detect network problems, and will be listening for Pub/Sub messages on a broken TCP connection for hours, making Pub/Sub unusable.

This is a common issue in redis clients and some redis clients like lettuce are already fixed . https://github.com/lettuce-io/lettuce-core/issues/1428

Refer to this issue for more info: https://github.com/redis/redis/issues/7855