diff --git a/src/networking.cpp b/src/networking.cpp index 7a28697d3..b25eeaf71 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -2712,7 +2712,7 @@ void readQueryFromClient(connection *conn) { if (cserver.cthreads > 1) { parseClientCommandBuffer(c); - if (g_pserver->enable_async_commands && (aeLockContention() || g_fTestMode)) + if (g_pserver->enable_async_commands && listLength(g_pserver->monitors) == 0 && (aeLockContention() || g_fTestMode)) processInputBuffer(c, false, CMD_CALL_SLOWLOG | CMD_CALL_STATS | CMD_CALL_ASYNC); if (!c->vecqueuedcmd.empty()) serverTL->vecclientsProcess.push_back(c); diff --git a/src/object.cpp b/src/object.cpp index ee6310c41..01b83b4c9 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1601,23 +1601,22 @@ robj *deserializeStoredStringObject(const char *data, size_t cb) newObject = createObject(OBJ_STRING, nullptr); newObject->encoding = oT->encoding; newObject->m_ptr = oT->m_ptr; - return newObject; + break; case OBJ_ENCODING_EMBSTR: newObject = createEmbeddedStringObject(szFromObj(oT), sdslen(szFromObj(oT))); - return newObject; + break; case OBJ_ENCODING_RAW: newObject = createObject(OBJ_STRING, sdsnewlen(SDS_NOINIT,cb-sizeof(robj)-sizeof(uint64_t))); newObject->lru = oT->lru; memcpy(newObject->m_ptr, data+sizeof(robj)+sizeof(mvcc), cb-sizeof(robj)-sizeof(mvcc)); - return newObject; + break; default: serverPanic("Unknown string object encoding from storage"); } setMvccTstamp(newObject, mvcc); - newObject->setrefcount(1); return newObject; } diff --git a/src/server.cpp b/src/server.cpp index 30a030052..eb50c18f5 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4777,7 +4777,7 @@ int processCommand(client *c, int callFlags) { * the event loop since there is a busy Lua script running in timeout * condition, to avoid mixing the propagation of scripts with the * propagation of DELs due to eviction. */ - if (g_pserver->maxmemory && !g_pserver->lua_timedout) { + if (g_pserver->maxmemory && !g_pserver->lua_timedout && !(callFlags & CMD_CALL_ASYNC)) { int out_of_memory = (performEvictions(false /*fPreSnapshot*/) == EVICT_FAIL); /* freeMemoryIfNeeded may flush replica output buffers. This may result * into a replica, that may be the active client, to be freed. */