Working on v6.3.4, I have a test module which calls RedisModule_Fork() periodically. I encountered a condition where KeyDB completely freezes, and the logs have stopped logged. Adding some logging, I tracked it down to redisFork() in server.cpp:
serverLog(LL_WARNING, "aeAcquireForkLock start");
aeAcquireForkLock();
serverLog(LL_WARNING, "aeAcquireForkLock finish");
when it freezes, "aeAcquireForkLock start" is printed but not the corresponding finish. Looking into this method, I can see a comment in the code:
if (exclusive) {
/* Another thread might have the write lock while we have the internal lock
but won't be able to release it until they can acquire the internal lock
so release the internal lock and try again instead of waiting to avoid deadlock */
while(!m_writeLock.try_lock())
m_cv.wait(rm);
}
The comment says it should release the internal lock and try again, but it looks like it is only trying again without any release?
I am still tracking this down, but if anyone has experienced the same issue, or has any advice on this, happy to take any suggestions to try out.
Note: I have Save "" in the config, so there is no background saving happening. From the logs, I cannot see other places that is trying to call the fork, so this deadlock scenario is a bit strange.
Working on v6.3.4, I have a test module which calls RedisModule_Fork() periodically. I encountered a condition where KeyDB completely freezes, and the logs have stopped logged. Adding some logging, I tracked it down to redisFork() in server.cpp:
when it freezes, "aeAcquireForkLock start" is printed but not the corresponding finish. Looking into this method, I can see a comment in the code:
The comment says it should release the internal lock and try again, but it looks like it is only trying again without any release?
I am still tracking this down, but if anyone has experienced the same issue, or has any advice on this, happy to take any suggestions to try out.
Note: I have Save "" in the config, so there is no background saving happening. From the logs, I cannot see other places that is trying to call the fork, so this deadlock scenario is a bit strange.