summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-12-05 10:38:18 +0100
committerantirez <antirez@gmail.com>2019-12-05 10:38:18 +0100
commit2271cf03f56525f153227c95b9521a5377321776 (patch)
tree3c2f8e053cbe68cb7a40f392f6b9d5e0ca18b069 /src
parentecb742acc5af59d887534cf7a40300a07db5873d (diff)
downloadredis-2271cf03f56525f153227c95b9521a5377321776.tar.gz
Modules: clarify when the disconnection callback is called.
Diffstat (limited to 'src')
-rw-r--r--src/module.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c
index 65c0f5b3f..111e1c202 100644
--- a/src/module.c
+++ b/src/module.c
@@ -4192,7 +4192,10 @@ void moduleBlockedClientPipeReadable(aeEventLoop *el, int fd, void *privdata, in
void unblockClientFromModule(client *c) {
RedisModuleBlockedClient *bc = c->bpop.module_blocked_handle;
- /* Call the disconnection callback if any. */
+ /* Call the disconnection callback if any. Note that
+ * bc->disconnect_callback is set to NULL if the client gets disconnected
+ * by the module itself, so the callback will NOT get called if this is
+ * not an actual disconnection event. */
if (bc->disconnect_callback) {
RedisModuleCtx ctx = REDISMODULE_CTX_INIT;
ctx.blocked_privdata = bc->privdata;