When Master + Slave, and lua scripting is used, BRPush and BRPop on a list were not replicated correctly to slave (the master was still correct though, so client still sees correct data as long as the master is alive).
Just the slave is not replicating correctly and leaking memory. No visible symptom to client as long as the master is alive.
Master + slave
I used the scripts provided by the reporter.
0. setup master/slave replication
1. lpush some elements
3. remove all elements (1 and 2 are sufficient to see the failure)
Order doesn’t matter too much
Client log yes
You can notice the memory growth on slave log:
 01 Sep 21:39:59.596 - 1 clients connected (0 slaves), 557152 bytes in use
 01 Sep 21:40:04.642 - DB 8: 1 keys (0 volatile) in 4 slots HT.
 01 Sep 21:40:04.642 - 1 clients connected (0 slaves), 557312 bytes in use
 01 Sep 21:40:09.687 - DB 8: 1 keys (0 volatile) in 4 slots HT.
 01 Sep 21:40:09.687 - 1 clients connected (0 slaves), 557472 bytes in use
Hard to figure out why the memory is growing unboundedly. The root cause is that when scripting was pushing data that is waited by more than one node (client + slave in this case), the slave was not correctly served.
The logic of handling script + synchronous blocking operations (BRPOP, BLPOP) are wrong.