diff --git a/src/anet.c b/src/anet.c index e9530398..2981fca1 100644 --- a/src/anet.c +++ b/src/anet.c @@ -484,7 +484,7 @@ static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backl if (af == AF_INET6 && anetV6Only(err,s) == ANET_ERR) goto error; if (anetSetReuseAddr(err,s) == ANET_ERR) goto error; - if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) goto error; + if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) s = ANET_ERR; goto end; } if (p == NULL) { diff --git a/src/blocked.c b/src/blocked.c index 23142d1d..1d59ee16 100644 --- a/src/blocked.c +++ b/src/blocked.c @@ -283,6 +283,7 @@ void handleClientsBlockedOnKeys(void) { if (listTypeLength(o) == 0) { dbDelete(rl->db,rl->key); + notifyKeyspaceEvent(NOTIFY_GENERIC,"del",rl->key,rl->db->id); } /* We don't call signalModifiedKey() as it was already called * when an element was pushed on the list. */ diff --git a/src/cluster.c b/src/cluster.c index 85fe265f..d0f19bff 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -600,8 +600,7 @@ clusterLink *createClusterLink(clusterNode *node) { * with this link will have the 'link' field set to NULL. */ void freeClusterLink(clusterLink *link) { if (link->fd != -1) { - aeDeleteFileEvent(server.el, link->fd, AE_WRITABLE); - aeDeleteFileEvent(server.el, link->fd, AE_READABLE); + aeDeleteFileEvent(server.el, link->fd, AE_READABLE|AE_WRITABLE); } sdsfree(link->sndbuf); sdsfree(link->rcvbuf); diff --git a/src/db.c b/src/db.c index 9086f9a6..5f733e2d 100644 --- a/src/db.c +++ b/src/db.c @@ -187,9 +187,6 @@ void dbOverwrite(redisDb *db, robj *key, robj *val) { int saved_lru = old->lru; dictReplace(db->dict, key->ptr, val); val->lru = saved_lru; - /* LFU should be not only copied but also updated - * when a key is overwritten. */ - updateLFU(val); } else { dictReplace(db->dict, key->ptr, val); } @@ -1359,7 +1356,7 @@ int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numk for (i = 5; i < argc; i++) { char *arg = argv[i]->ptr; /* For the case when user specifies both "store" and "storedist" options, the - * second key specified would override the first key. This behavior is kept + * second key specified would override the first key. This behavior is kept * the same as in georadiusCommand method. */ if ((!strcasecmp(arg, "store") || !strcasecmp(arg, "storedist")) && ((i+1) < argc)) { @@ -1380,7 +1377,7 @@ int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numk if(num > 1) { keys[1] = stored_key; } - *numkeys = num; + *numkeys = num; return keys; } diff --git a/src/object.c b/src/object.c index 43bef1e4..82b82632 100644 --- a/src/object.c +++ b/src/object.c @@ -113,7 +113,7 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) { * OBJ_ENCODING_EMBSTR_SIZE_LIMIT, otherwise the RAW encoding is * used. * - * The current limit of 39 is chosen so that the biggest string object + * The current limit of 44 is chosen so that the biggest string object * we allocate as EMBSTR will still fit into the 64 byte arena of jemalloc. */ #define OBJ_ENCODING_EMBSTR_SIZE_LIMIT 44 robj *createStringObject(const char *ptr, size_t len) { diff --git a/src/t_list.c b/src/t_list.c index c7e6aac0..1414ff31 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -639,6 +639,10 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb addReplyMultiBulkLen(receiver,2); addReplyBulk(receiver,key); addReplyBulk(receiver,value); + + /* Notify event. */ + char *event = (where == LIST_HEAD) ? "lpop" : "rpop"; + notifyKeyspaceEvent(NOTIFY_LIST,event,key,receiver->db->id); } else { /* BRPOPLPUSH */ robj *dstobj = @@ -663,6 +667,9 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb db->id,argv,3, PROPAGATE_AOF| PROPAGATE_REPL); + + /* Notify event ("lpush" was notified by rpoplpushHandlePush). */ + notifyKeyspaceEvent(NOTIFY_LIST,"rpop",key,receiver->db->id); } else { /* BRPOPLPUSH failed because of wrong * destination type. */