Cleanup nested module keyspace notifications (#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.
This commit is contained in:
Oran Agra 2023-10-05 12:50:17 +02:00 committed by GitHub
parent 2cf50ddbad
commit fe37e4fc87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8763,11 +8763,12 @@ void moduleNotifyKeyspaceEvent(int type, const char *event, robj *key, int dbid)
/* mark the handler as active to avoid reentrant loops.
* If the subscriber performs an action triggering itself,
* it will not be notified about it. */
int prev_active = sub->active;
sub->active = 1;
server.lazy_expire_disabled++;
sub->notify_callback(&ctx, type, event, key);
server.lazy_expire_disabled--;
sub->active = 0;
sub->active = prev_active;
moduleFreeContext(&ctx);
}
}