mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
add linkClient(): adds the client and caches the list node.
We have this operation in two places: when caching the master and when linking a new client after the client creation. By having an API for this we avoid incurring in errors when modifying one of the two places forgetting the other. The function is also a good place where to document why we cache the linked list node. Related to #4497 and #4210.
This commit is contained in:
@ -2214,8 +2214,7 @@ void replicationResurrectCachedMaster(int newfd) {
|
||||
server.repl_down_since = 0;
|
||||
|
||||
/* Re-add to the list of clients. */
|
||||
listAddNodeTail(server.clients,server.master);
|
||||
server.master->client_list_node = listLast(server.clients);
|
||||
linkClient(server.master);
|
||||
if (aeCreateFileEvent(server.el, newfd, AE_READABLE,
|
||||
readQueryFromClient, server.master)) {
|
||||
serverLog(LL_WARNING,"Error resurrecting the cached master, impossible to add the readable handler: %s", strerror(errno));
|
||||
|
Reference in New Issue
Block a user