In case of modules, ThreadSafeContexts can use RM_ReplyWith* family functions from threads. If RM_ReplyWithError() is called, it might lead to a call to afterErrorReply() first and then incrementErrorCount() . Inside this function, server.errors table will be accessed/modified without synchronization with the main thread or other threads.
Problematic call stack would be :
A call for a thread-safe context :
1- RM_ReplyWithError()
2- addReplyErrorFormat()
3- afterErrorReply()
4- incrementErrorCount()
Introduced by https://github.com/redis/redis/pull/8217