diff --git a/src/networking.cpp b/src/networking.cpp index f5698282b..9c4266df4 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -1915,8 +1915,10 @@ void ProcessPendingAsyncWrites() if (c->fPendingAsyncWriteHandler.compare_exchange_strong(expected, true)) { bool fResult = c->postFunction([](client *c) { c->fPendingAsyncWriteHandler = false; - clientInstallWriteHandler(c); - handleClientsWithPendingWrites(c->iel, g_pserver->aof_state); + if (c->bufpos || listLength(c->reply) || (c->flags & CLIENT_PENDING_WRITE)) { + clientInstallWriteHandler(c); + handleClientsWithPendingWrites(c->iel, g_pserver->aof_state); + } }, false); if (!fResult)