From 268f2efb480d99cef61bf13330f3a422b41ac932 Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 11 May 2020 01:02:58 -0400 Subject: [PATCH] Fix crash during RDB save with module events Former-commit-id: 0f7eac411eccb853d7e50152e2bbd1ee28e6ee53 --- src/module.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/module.cpp b/src/module.cpp index 1f07a0e9b..682dc1830 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -7222,6 +7222,8 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) { * cheap if there are no registered modules. */ if (listLength(RedisModule_EventListeners) == 0) return; + aeAcquireLock(); + listIter li; listNode *ln; listRewind(RedisModule_EventListeners,&li); @@ -7286,6 +7288,8 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) { moduleFreeContext(&ctx); } } + + aeReleaseLock(); } /* Remove all the listeners for this module: this is used before unloading