mirror of
https://github.com/fluencelabs/redis
synced 2025-05-02 22:12:15 +00:00
Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary.
This commit is contained in:
parent
f2ac94876d
commit
b04e800b98
@ -354,7 +354,7 @@ int rewriteAppendOnlyFile(char *filename) {
|
|||||||
redisDb *db = server.db+j;
|
redisDb *db = server.db+j;
|
||||||
dict *d = db->dict;
|
dict *d = db->dict;
|
||||||
if (dictSize(d) == 0) continue;
|
if (dictSize(d) == 0) continue;
|
||||||
di = dictGetIterator(d);
|
di = dictGetSafeIterator(d);
|
||||||
if (!di) {
|
if (!di) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
|
@ -416,7 +416,7 @@ int rdbSave(char *filename) {
|
|||||||
redisDb *db = server.db+j;
|
redisDb *db = server.db+j;
|
||||||
dict *d = db->dict;
|
dict *d = db->dict;
|
||||||
if (dictSize(d) == 0) continue;
|
if (dictSize(d) == 0) continue;
|
||||||
di = dictGetIterator(d);
|
di = dictGetSafeIterator(d);
|
||||||
if (!di) {
|
if (!di) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user