Skip to content

Commit fe37e4f

Browse files
authored
Cleanup nested module keyspace notifications (redis#12630)
Recently we added a way for the module to declare that it wishes to receive nested KSN, by setting ALLOW_NESTED_KEYSPACE_NOTIFICATIONS. but it looks like this flow has a bug, clearing the `active` member when it was previously set. however, since nesting is permitted, this bug has no implications, since regardless of the active member, the notification is permitted.
1 parent 2cf50dd commit fe37e4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8763,11 +8763,12 @@ void moduleNotifyKeyspaceEvent(int type, const char *event, robj *key, int dbid)
87638763
/* mark the handler as active to avoid reentrant loops.
87648764
* If the subscriber performs an action triggering itself,
87658765
* it will not be notified about it. */
8766+
int prev_active = sub->active;
87668767
sub->active = 1;
87678768
server.lazy_expire_disabled++;
87688769
sub->notify_callback(&ctx, type, event, key);
87698770
server.lazy_expire_disabled--;
8770-
sub->active = 0;
8771+
sub->active = prev_active;
87718772
moduleFreeContext(&ctx);
87728773
}
87738774
}

0 commit comments

Comments
 (0)