diff options
author | antirez <antirez@gmail.com> | 2017-09-21 12:35:04 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-09-21 15:46:49 +0200 |
commit | 1c60b7a67155823514fa626dfbae4036f40dded9 (patch) | |
tree | 34951e35abe97c75e63a266844278d626ec13e4f | |
parent | 368124e8fab0ef0791f1cff4cb9c7a83ed18b039 (diff) | |
download | redis-1c60b7a67155823514fa626dfbae4036f40dded9.tar.gz |
Clarify comment in change fixing #4323.
-rw-r--r-- | src/slowlog.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/slowlog.c b/src/slowlog.c index a95147153..32ec4374c 100644 --- a/src/slowlog.c +++ b/src/slowlog.c @@ -75,8 +75,12 @@ slowlogEntry *slowlogCreateEntry(client *c, robj **argv, int argc, long long dur } else if (argv[j]->refcount == OBJ_SHARED_REFCOUNT) { se->argv[j] = argv[j]; } else { - /* Duplicate a string object, - * avoid memory leak for lazyfree. */ + /* Here we need to dupliacate the string objects composing the + * argument vector of the command, because those may otherwise + * end shared with string objects stored into keys. Having + * shared objects between any part of Redis, and the data + * structure holding the data, is a problem: FLUSHALL ASYNC + * may release the shared string object and create a race. */ se->argv[j] = dupStringObject(argv[j]); } } |