Hold the AE lock until we process the repl backlog after a command

Former-commit-id: 4893eedacbf5f9210d02361ed07b9beee0c9f655
This commit is contained in:
John Sully 2020-05-24 11:19:23 -04:00
parent 0d8c7c7182
commit 7630b63f06
3 changed files with 4 additions and 4 deletions

View File

@ -2326,7 +2326,8 @@ void commandProcessed(client *c) {
int processCommandAndResetClient(client *c, int flags) {
int deadclient = 0;
serverTL->current_client = c;
if (processCommand(c, flags) == C_OK) {
AeLocker locker;
if (processCommand(c, flags, locker) == C_OK) {
commandProcessed(c);
}
if (serverTL->current_client == NULL) deadclient = 1;

View File

@ -3621,8 +3621,7 @@ void call(client *c, int flags) {
* If C_OK is returned the client is still alive and valid and
* other operations can be performed by the caller. Otherwise
* if C_ERR is returned the client was destroyed (i.e. after QUIT). */
int processCommand(client *c, int callFlags) {
AeLocker locker;
int processCommand(client *c, int callFlags, AeLocker &locker) {
AssertCorrectThread(c);
if (moduleHasCommandFilters())

View File

@ -2542,7 +2542,7 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
size_t freeMemoryGetNotCountedMemory();
int freeMemoryIfNeeded(void);
int freeMemoryIfNeededAndSafe(void);
int processCommand(client *c, int callFlags);
int processCommand(client *c, int callFlags, class AeLocker &locker);
void setupSignalHandlers(void);
struct redisCommand *lookupCommand(sds name);
struct redisCommand *lookupCommandByCString(const char *s);