diff --git a/src/t_string.c b/src/t_string.c index 04eb79412..67b362d1f 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -612,10 +612,10 @@ void incrDecrCommand(client *c, long long incr) { dbAdd(c->db,c->argv[1],new); } } + addReplyLongLongFromStr(c,new); signalModifiedKey(c,c->db,c->argv[1]); notifyKeyspaceEvent(NOTIFY_STRING,"incrby",c->argv[1],c->db->id); server.dirty++; - addReplyLongLongFromStr(c,new); } void incrCommand(client *c) { diff --git a/tests/unit/moduleapi/keyspace_events.tcl b/tests/unit/moduleapi/keyspace_events.tcl index 1323b1296..30fdc1e2b 100644 --- a/tests/unit/moduleapi/keyspace_events.tcl +++ b/tests/unit/moduleapi/keyspace_events.tcl @@ -3,6 +3,10 @@ set testmodule [file normalize tests/modules/keyspace_events.so] tags "modules" { start_server [list overrides [list loadmodule "$testmodule"]] { + # avoid using shared integers, to increase the chance of detection heap issues + r config set maxmemory-policy allkeys-lru + r config set maxmemory 1gb + test {Test loaded key space event} { r set x 1 r hset y f v