Make propagating before freeing module context optional (#225)
* don't propogate on module context free for rdb load * default in wrong place
This commit is contained in:
parent
820482bffe
commit
7d4f461562
@ -690,7 +690,8 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free the context after the user function was called. */
|
/* Free the context after the user function was called. */
|
||||||
void moduleFreeContext(RedisModuleCtx *ctx) {
|
void moduleFreeContext(RedisModuleCtx *ctx, bool propogate) {
|
||||||
|
if (propogate)
|
||||||
moduleHandlePropagationAfterCommandCallback(ctx);
|
moduleHandlePropagationAfterCommandCallback(ctx);
|
||||||
autoMemoryCollect(ctx);
|
autoMemoryCollect(ctx);
|
||||||
poolAllocRelease(ctx);
|
poolAllocRelease(ctx);
|
||||||
|
@ -2542,7 +2542,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error, uint64_t mvcc_ts
|
|||||||
* encoding version in the lower 10 bits of the module ID. */
|
* encoding version in the lower 10 bits of the module ID. */
|
||||||
void *ptr = mt->rdb_load(&io,moduleid&1023);
|
void *ptr = mt->rdb_load(&io,moduleid&1023);
|
||||||
if (io.ctx) {
|
if (io.ctx) {
|
||||||
moduleFreeContext(io.ctx);
|
moduleFreeContext(io.ctx, false /* propogate */);
|
||||||
zfree(io.ctx);
|
zfree(io.ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2918,7 +2918,7 @@ int moduleGetCommandKeysViaAPI(struct redisCommand *cmd, robj **argv, int argc,
|
|||||||
moduleType *moduleTypeLookupModuleByID(uint64_t id);
|
moduleType *moduleTypeLookupModuleByID(uint64_t id);
|
||||||
void moduleTypeNameByID(char *name, uint64_t moduleid);
|
void moduleTypeNameByID(char *name, uint64_t moduleid);
|
||||||
const char *moduleTypeModuleName(moduleType *mt);
|
const char *moduleTypeModuleName(moduleType *mt);
|
||||||
void moduleFreeContext(struct RedisModuleCtx *ctx);
|
void moduleFreeContext(struct RedisModuleCtx *ctx, bool propogate = true);
|
||||||
void unblockClientFromModule(client *c);
|
void unblockClientFromModule(client *c);
|
||||||
void moduleHandleBlockedClients(int iel);
|
void moduleHandleBlockedClients(int iel);
|
||||||
void moduleBlockedClientTimedOut(client *c);
|
void moduleBlockedClientTimedOut(client *c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user